Excel’s Macros are best for automating tasks in a workbook. Once you record a Macro, you could replay them whenever needed or copy them to another workbook. But, in order to create, run, and use all other functionalities of a Macro, the feature must be enabled in your workbook.
“Macros have been Disabled” Error
Excel disables Macros by default in Microsoft 365 files for security reasons. This is because Macros can sometimes be harmful to your computer. It may introduce malicious viruses and malware into the system.
The security warning message “Macros have been disabled” can only be turned off if you manually enable macros.
How to Enable Macros in Excel?
There are three ways to enable Macros in Excel. If you wish to turn it on only for a single workbook, you can make your document trusted. To enable the Macros for all workbooks, you could opt for the Excel Trust Center menu. Similarly, to permanently turn on Macros, you can create a Trusted Location.
Make Your Document Trusted
At first, if you open a new workbook with Macros disabled, Excel will send you a Security Warning. But don’t worry! The warning is just to inform you that the file could have viruses or malware that can harm your PC. You can also see there’s an Enable Content button in the same warning message.
Click Enable Content button to make your current workbook a Trusted Document. You’ll be prompted to confirm on the Security Warning dialogue box. Pick Yes. You should be able to use Macros now. Remember, this method will turn on Macro for only this document.
Alternatively, you can also Enable Content from the Info menu.
- On Excel, go to Files > Info.
- On Security Warning, click on Enable Content menu and pick Enable All Content.
From Trust Center
If you do not see a Security Warning in your workbook, use this method to turn on Macros. Excel’s Trust Center has the default Macro Settings. You can find various disable and enable options. Here, we will pick Enable VBA option to allow all Macros. Remember, the Macro Settings you change will apply to Excel app only.
- Launch Excel.
- Click Options menu at the bottom-left.
- On Excel Options, head to Trust Center category. Click Trust Center Settings.
- On Trust Center window, click Macro Settings.
- Below Macro Settings, check the box for Enable VBA macros(not recommended; potentially dangerous code can run)
- Click OK.
Create Trusted Location
If you enable the Macros from the Macro Settings, you can modify the settings or disable them in the future. However, if you want to permanently enable Macros at all times, you could create a folder as a Trusted Location. When you do this, all Macro files from the Trusted location will run regardless of Macro Settings.
- Launch Excel and go to the Options menu.
- Click Trust Center and go to Trust Center Settings.
- On left panel, head to Trusted Locations and choose Add new location.
- On Microsoft Office Trusted Location, hit Browse.
- Select a Folder as a Trusted Location and hit OK.
- Tick the box for Subfolders of this located are also trusted if you want them to be trusted.
- Enter a Description for the Trusted file. This is completely optional.
- Click OK.
- Hit OK on all other open windows to confirm.
Macro Security Settings
Excel’s Macro Security has several options to control where, when, and what Macros to run in a workbook. To allow all Macros, we chose the Enable VBA Macros above. But, if you want to change the Macro Settings later, you can learn what each settings mean below.
Before you begin, open the Macro Settings from Trust Center settings or the Developer tab.
- Disable VBA macros without notification: Completely disable Macros without any security alerts. But, the documents stored in trusted locations can run.
- Disable VBA macros with notification: Disable Macros but get Security alerts if a document has Macros. You’ll get Enable Macros button in Security Warning. This will allow you to selectively choose to enable Macros depending on the case.
- Disable VBA macros except for digitally signed macros: Allow only digitally signed Macros to run. You’ll get a notification if the publisher is not trusted. This setting disables all other unsigned Macros without alerts.
- Enable VBA macros(not recommended; potentially dangerous code can run): Allow all kinds of Macros to run including the Malicious ones.
- Enable Excel 4.0 macros when VBA macros are enabled: Apply the Macro Settings to XLM Macros.
- Trust access to the VBA project object model: Settings for Developers to allow or block the access to VBA project object model. If you disable the setting, it adds a layer of protection from viruses to your PC. However, if you allow it, Macro Viruses will spread through the system using VBA project systems.
Related Questions
How to solve “Microsoft has blocked Macros from running?”
All the Office programs block the Macro files imported from the internet by default. So if you’re attempting to open one, you’ll get the “Microsoft has blocked Macros from running” error. To unblock a file, locate the document in file explorer. Right-click on the blocked file and pick Properties. On the Properties window, stay on the General tab. Next to the Security menu, tick the box for Unblock and hit OK.