VBA Error 400: What Is It And How to Fix It [3 Easy Ways]

Make sure you double-check your code as errors can easily creep in.

Reading time icon 2 min. read


Readers help support Windows Report. We may get a commission if you buy through our links. Tooltip Icon

Read our disclosure page to find out how can you help Windows Report sustain the editorial team. Read more

Key notes

  • Excel Macro represents a set of commands and actions that are triggered by a VBA code.
  • As handy as it has proven to be, VBA is no stranger to errors especially if you write the code yourself.
  • The VBA error 400 is quite common and usually appears if your Macro fails or crashes whilst it’s running.
  • Don't worry, we have prepared 3 easy fixes for you to try in order to remove this pesky error for good.
how to resolve VBA error 400

When you have a set of actions that you do constantly, creating a Macro in Excel is crucial.

Once you create it, it runs on its own and delivers great reports. That is if you don’t get any error.

Some users seem to be getting a VBA error 400 when trying to run their Macro in Excel. There are no further indications only a box with an OK button.

How can I solve VBA error 400 in Excel?

Either way, don’t worry we have some simple solutions for you.

We suggest that you follow the steps mentioned in this article in the presented order. Hopefully, they will help you solve your problem.

    1. Fix VBA error 400 by moving your Macros to another Module

    If you are getting the VBA error 400 in Excel while trying to run your Macros, moving them to a new Module can fix it.

    There could be a problem with the old Module, therefore switching to a new one might fix the error.

  1. 1. Open Microsoft Excel.

  2. 2. We need to create the new Module to transfer your Macros to. Click on the Developer tab from the Ribbon menu.

    how to fix vba error 404 developer tab
  3. 3. Select Visual Basic from the options.

    visual basics how to fix vba error 400
  4. 4. In the VBA menu, click Module on the Insert menu.

    fix vba error 400 select module
  5. 5. Paste the VBA code that you want to use.

  6. 6. Navigate to the File menu and click Save Global. Now your Macros are successfully moved to the new Module.

  7. 7. Delete the old module.

2. Fix VBA error 400 by turning on the trusted access

how to resolve excel VBA error message
  1. Go to the Developer tab (If this is not available click File > Options > Customise Ribbon > choose the Developer checkbox).
  2. In the  Code group – go to the Developer tab.
  3. Click Macro Security.
  4. Select Developer Macro Settings – choose Trusted access to the VBA project.

3. Check your code for mistakes to fix VBA error 400

how to fix VBA error in excel macros

Make sure to always check your code for any mistakes. Additionally, checking for any macros corruption is necessary as well.

That’s about it. We hope that doing these confirmed solutions will fix your VBA 400 Error. In case you have other confirmed suggestions please let us know in a comment below.

More about the topics: Excel, Fix corrupt files

User forum

0 messages