Microsoft Office Applications (Excel, Word, PowerPoint) return different errors with reference to VBA or macros being disabled? Enable VBA for Microsoft Excel!
There are multiple ways to disable/enable VBA but most common is the one I will mention below because the other ones imply other software or system policies or settings that take time and are not used unless something forbids below version. In other words, the first thing you should check is this method, else do ask about it and you will get the other ways too.
This Registry setting prevents Excel, FrontPage, Outlook, PowerPoint, Publisher and Word from using Visual Basic for Applications.
This setting will help you in either blocking the access of users via above applications to Visual Basic or enabling it if it was blocked before, with or without knowledge.
- First of all, close all Office applications.
Open the registry editor: go to start – run – type “regedit” without the quotes and press enter.
Depending on the Operating System you use, we have the following paths to these registry keys:
Office 2003 – HKEY_LOCAL_MACHINE\Software\Microsoft\Office\11.0\Common
Office XP – HKEY_LOCAL_MACHINE\Software\Microsoft\Office\10.0\Common
Office 2007 – HKEY_LOCAL_MACHINE\Software\Microsoft\Office\12.0\Common
Office 2010 – HKEY_LOCAL_MACHINE\Software\Microsoft\Office\14.0\Common
Office 2003 – HKEY_CURRENT_USER\Software\Microsoft\Office\11.0\Common
Office XP – HKEY_CURRENT_USER\Software\Microsoft\Office\10.0\Common
Office 2007 – HKEY_CURRENT_USER\Software\Microsoft\Office\12.0\Common
Office 2010 – HKEY_CURRENT_USER\Software\Microsoft\Office\14.0\Common
I should also add in here that you will have to match your operating system with the corresponding registry keys from above HKCU AND HKLM paths. I strongly encourage you to check both of them for this registry key called VBAOff, and this is the reason why I used KKCU AND HKLM in the previous sentence and not OR, as even if most of the times you will find it in HKCU, it can also be causing the problem if you have the one from HKLM set to 1, or even both of them in some cases.
Now it all depends on what you want to do. For disabling the option (allowing VBA to work) you will just have to modify the registry key value from 1 to 0. If however, your goal is to enable this protection and disable VBA, you will have to add the following registry key “VBAOff” without quotes to one of the above paths that match your version and give it a value of “1”.
To add the key you will have to do the next steps:
- Right click the last word from the path, in our case Common, click on New then select DWORD Value.
Type “VBAOff” without quotes when it asks for name and press Enter.
Right click VBAOff and then select Modify; in the Value data insert from your keyboard the value of “1” and press Ok.
Close registry editor.
I also have another solution for you, if you haven’t already figured it out, and that is to use search for this key called VBAOff. This solution will be slightly slower, as you will have to rely all your trust on your computer to do the search on EACH of the keys until he reaches the searched one, and then resume using F3 for other possible ones. This one is a solution I would avoid due to the fact of being a bit weird to check after, because you will have to just search it manually by navigating through the registry keys. Follow above pattern just to see if it is indeed there and if it is changed. So in the end, by using this, you will probably do the above steps just to check.
One faster way would be just to assume that the problem is due to the same registry key called VBAOff but located as most of the times in HKCU. You will have to save below text (paste) to a file called as you want, for example “EnableVBA” with an extension of reg as in EnableVBA.reg :
Windows Registry Editor Version 5.00
Now execute the file and it will modify that key, WHERE found and will set it to “0”, which will enable VBA.
If you have different situations or scenarios for me, don’t hesitate to pop a question and I will be more than happy to help you figure it out.
I won’t add one similar script for HKLM as that would need a higher level of access like an administrator, as those are Local Machine settings and can be done remotely by your system administrator if needed and you are not in a position to do them by yourself.