Yes, the message “Because of your security settings, macros have been disabled” means Excel’s Trust Center has blocked VBA macros from running, and you can fix it by changing the macro security setting to “Disable VBA macros with notification” or by unblocking the specific file. This is a built-in safety feature, not an error in your workbook.
Why Excel Blocks Macros by Default
Macros are small programs written in VBA (Visual Basic for Applications) that automate repetitive tasks. Because they can run code on your computer, they are a common way to spread malware. Microsoft therefore sets the default macro security level to “Disable VBA macros with notification,” which means Excel silently disables macros unless you explicitly enable them for that session or file.
The Trust Center is the control panel for these security settings. It applies to all Office programs, not just Excel. The settings are stored in the Windows registry or in a configuration file, and they affect every workbook you open, unless a file is explicitly trusted.
How to Enable Macros in Excel (Microsoft 365 / Windows)
To allow macros to run, you have two main paths: change the global security setting, or trust a specific file. The global setting is the most direct.
- Open Excel and go to File > Options.
- Click Trust Center, then Trust Center Settings.
- Select Macro Settings on the left.
- Choose “Disable VBA macros with notification” (recommended) or “Enable VBA macros” (less secure).
- Click OK twice.
After this, when you open a workbook with macros, a yellow bar appears with an Enable Content button. Click it to run macros for that file only. If you choose “Enable VBA macros” without notification, Excel will run macros automatically, which is riskier.
On a Mac, the path is slightly different: Excel > Preferences > Security, then set “Macro Security” to “Enable all macros” or “Disable with notification.” The yellow bar works similarly.
Unblocking a Single Workbook (File Properties)
If you downloaded a workbook from the internet or received it via email, Windows marks it as “blocked.” Even if your macro security is set to “Enable,” Excel may still show the disabled message. To unblock a single file:
- Right-click the file in File Explorer and select Properties.
- At the bottom of the General tab, check Unblock.
- Click Apply and then OK.
This removes the Mark-of-the-Web (MOTW) flag, which is a hidden attribute that tells Office the file came from another computer. After unblocking, the yellow bar should appear when you open the file, allowing you to enable macros.
What to Do If the Yellow Bar Doesn’t Appear
Sometimes you change the setting to “Disable with notification” but the yellow bar still doesn’t show. This can happen if the file is already open, or if the workbook is in a trusted location. Check these:
- Close and reopen the workbook.
- Check if the file is in a Trusted Location (File > Options > Trust Center > Trusted Locations). Files in trusted locations run macros automatically without prompts.
- Make sure “Disable VBA macros with notification” is selected, not “Disable all macros without notification.”
- Check if the file extension is .xlsm (macro-enabled). If it’s .xlsx, macros are stripped out and cannot run.
If you’re using Excel for the web, macros are not supported at all. You must open the file in the desktop version to run VBA.
Comparing Security Levels: Which One Should You Choose?
Excel offers four macro security levels. Here’s what they do:
- Disable all macros without notification: Macros are always disabled, and you are never told why. This is the most secure but also the most frustrating because you can’t enable a trusted file.
- Disable all macros with notification: Macros are disabled, but you see a yellow bar with an “Enable Content” button. This is the recommended default.
- Disable all macros except digitally signed macros: Macros signed by a trusted publisher run automatically; unsigned macros are disabled with notification.
- Enable all macros: Macros run without any prompt. This is dangerous and should only be used temporarily for files you fully trust.
For most users, “Disable with notification” is the best balance. You can always enable a macro on a case-by-case basis.
Common Problems and Misconceptions
One frequent misconception is that the message means the file is corrupted. It isn’t; it’s just a security prompt. Another is that changing the setting to “Enable all macros” will fix everything—it will, but it also opens the door to malicious code. A safer approach is to unblock the file or add the folder to Trusted Locations.
Another issue: if you have a digitally signed macro, but the certificate is not trusted, Excel will still block it. You can add the certificate to your Trusted Publishers list (File > Options > Trust Center > Trusted Publishers).
If you’re using a corporate computer, your IT department may have disabled macro settings via Group Policy, so you cannot change them. In that case, contact your IT support.
Frequently Asked Questions
Q: How do I enable macros in Excel permanently?
Go to File > Options > Trust Center > Trust Center Settings > Macro Settings and select “Enable VBA macros.” This enables macros for all files, which is not recommended. Better: use “Disable with notification” and click “Enable Content” each time.
Q: Why does Excel say macros are disabled even when I set “Enable all macros”?
This usually happens because the file is marked as blocked (from the internet or email). Right-click the file, choose Properties, and check “Unblock.” Also ensure the file has a .xlsm extension.
Q: Can I run macros in Excel for the web?
No, Excel for the web does not support VBA macros. You need the desktop version of Excel (Windows or Mac).
Q: What is a trusted location and how do I add one?
A trusted location is a folder where Excel automatically trusts files, so macros run without prompts. To add one: File > Options > Trust Center > Trust Center Settings > Trusted Locations > Add new location. Be careful: only add folders you control.
Q: How do I remove a digital signature from a macro?
You can’t remove a signature directly. Instead, you can disable the signature check by adding the signer to Trusted Publishers, or by changing the macro security to “Enable all macros.”
Safety Tips When Enabling Macros
Before you enable macros, consider the source. If you didn’t create the file and you don’t trust the sender, don’t enable macros. Malicious macros can delete files, send emails, or install ransomware. Always scan the file with antivirus software first. If you’re a developer, test macros in a copy of the workbook so you don’t lose data if something goes wrong.
To protect yourself further, keep your Office software updated, and consider using “Protected View” for files from the internet. Protected View opens the file in a sandboxed environment where macros are disabled. You can click “Enable Editing” to leave Protected View, but that also re-enables macros if your security setting allows.
Related
- Excel Consolidated Sdn Bhd: Company Profile & Services
- Windows Shortcuts Cheat Sheet: 50+ Essential Keys
- Convert to String BigQuery: CAST & SAFE_CAST Guide
Try it: the Column Letter to Number: aA is 27, XFD is 16,384. Converts both ways.
More in VBA & macros
- VBA Get Character From String: Mid, Loops & TipsTo get one character from a VBA string by position, use Mid$(text, position, 1). For example, Mid$("Excel VBA",…
- VBA InputBox: How It Works, Limits, and When to UseYes—VBA’s InputBox is fine for a quick, simple prompt, such as asking for a name or a short…
- Excel VBA Clear Dictionary: Methods, Examples, and TipsTo empty a VBA Scripting.Dictionary, call its RemoveAll method: dict.RemoveAll. This removes every key and item while leaving…
- Visual Basic: Add a Comment to an Excel Cell with VBAYes. In Excel for Microsoft 365 on Windows, use VBA’s Range.AddComment method to add a note to a…
- VBA Contains String Function? How to Find Text with InStrYes—VBA can check whether one string contains another, but it does not have a built-in string method named…
- How to Assign a Macro to a Mouse ButtonAssigning a macro to a mouse button lets you trigger a sequence of actions—like a series of keystrokes,…
Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources
Spotted an error in this guide? Let us know.