VBA error 400: What is it and how to fix it

Vlad Turiceanu
by Vlad Turiceanu
Editor-in-Chief
0 Comments
Download PDF
Affiliate Disclosure

  • Excel Macro represents a set of commands and actions that are triggered by a VBA code
  • Usually, an Excel error 400 can happen if your Macro fails or crashes whilst it’s running.
  • Remember to check our Fix Corrupt Files Hub category for more interesting articles
  • Don't hesitate to bookmark our Microsoft Excel Guides for more related articles.
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.

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.

How can I solve error 400 in Excel?

1. Move your Macros to a new Module

  1. To create a new module go to the Tools menu.
  2. Click Macro – Visual Basic Editor.
  3. In the VBA click Module on the Insert menu.
  4. Paste the VBA code that you want to use.
  5. In the File menu click Save Global.
  6. Make sure to delete the old module.

2. Turn on the trusted access to VBA

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

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 this confirmed solutions will fix your VBA 400 Error. In case you have other confirmed suggestions please let us know in a comment below.

FAQ: Learn more about Microsoft Excel

  • Is VBA worth learning?

Without a doubt, VBA brings a lot of advantages and it’s the quickest way to automate your tasks and reports within Microsoft Office. Have a look at our selection of the best automated macro software.

  • How do I permanently save a macro in Excel?

To permanently save a macro in Excel, open the Developer Tab, and record your macro. You can find more in-depth details in this guide.

  • Why is my macro not running automatically?

Macro requires special permissions in order to run automatically. Additionally, you can manually run it each time you need it.

Was this page helpful?
Thanks for letting us know! You can also help us by leaving a review on MyWOT or Trustpillot.
Get the most from your tech with our daily tips
Tell us why!