VBA – How to avoid Auto_Open execution and similars


We love macros (well, I love them!). They save our lives automating the most annoying part of our job. Macros are the best! But, it depends on what kind of macros we’re talking about.

Here, the annoying macros are knowing as “auto started macros”, mainly, the Auto_Open Sub. I’ve already described how it works in this post. In a nutshell, the Auto_Open Sub executes when the application starts. The most common usage of this special Subs are present some information or alerts about the application, splash screens and, of course, the annoying part, turns the Excel invisible, hides toolbars, disables shortcuts, etc. After this, it’s impossible to have access to VBA IDE, check the code, debug and so on.

Unfortunately, disable the macros is not an option because of you can’t reactivate them unless you close and open the workbook again.

Fortunately, there is an easy, actually, super easy way to avoid the Auto_Open Sub execution, even with macros enabled. Try to open the workbook holding the Shitf key, choosing the “Enable macros” option.

Enable Macros

And here it is! There are no differences besides the fact that the Auto_Open will not execute. Everything else will work perfectly. If the code inside the Auto_Open is essential for the application, you can execute it manually.