On this page · 12 sections
- Which macro message are you seeing?
- How to enable macros in one Excel workbook
- Macros blocked from the internet: the red Security Risk bar
- Change macro settings in the Trust Center (Excel for Windows)
- Use a trusted location for files you open often
- How to enable macros in Excel for Mac
- Excel for the web and mobile apps
- Worked example: test that macros now run
- Troubleshooting
- For IT teams and businesses
- How eCorpIT can help
- References
Summary. To enable macros in a workbook you trust, open it, select Enable Content on the yellow SECURITY WARNING bar and, if asked, select Yes to make it a trusted document. A red SECURITY RISK bar means Microsoft has blocked macros from an untrusted source, and it has no button: close the file, right-click it in File Explorer, choose Properties, tick Unblock on the General tab, select OK and reopen it. The trigger is Mark of the Web, the tag Windows adds to downloads and email attachments; blocking became the default in Current Channel Version 2206 (rolling out from 27 July 2022) and Semi-Annual Enterprise Channel Version 2208 (10 January 2023). The lasting setting is at File > Options > Trust Center > Trust Center Settings > Macro Settings, where Excel offers four VBA options and the default is Disable VBA macros with notification. For files you open every week, a trusted location is safer than enabling all macros. Excel for Mac has three options, Excel for the web cannot run VBA, and on managed PCs, IT policy overrides all of this.
About this article. It is for anyone who needs to run VBA macros in Excel, and for IT teams who set macro policy. On 15 November 2026 we checked every step, label, shortcut and date against Microsoft Support, Microsoft Learn, and Microsoft's update history and lifecycle pages. The steps apply to Excel for Microsoft 365 on Windows (Current Channel Version 2610, Build 20527.20196) and on Mac (Version 16.115), both released 10 November 2026, and to Excel 2024. Excel 2016, 2019 and 2021 use the same paths, but Microsoft ended support for Office 2016 and 2019 on 14 October 2025 and for Office 2021 on 13 October 2026. Labels can differ slightly by update channel. This is general guidance, not a security review. Researched with AI assistance and reviewed by our editorial team.
Which macro message are you seeing?
Find the message, then go to the matching section.
| What Excel shows | What it usually means | Fix |
|---|---|---|
| Yellow SECURITY WARNING bar with Enable Content | Default setting; no internet tag on the file | Select Enable Content, and Yes if asked |
| Red SECURITY RISK bar saying macros are blocked because the source is untrusted | The file carries Mark of the Web | Close it, tick Unblock in Properties, reopen |
| A message saying your administrator has restricted macros | IT policy blocks macros in that location | Save it to OneDrive or another approved location |
| No message, and macros do nothing | Macro setting is Disable VBA macros without notification | Change the macro setting |
| Macro buttons do nothing in a browser | Excel for the web cannot run VBA | Select Open in Desktop App |
| An .xla or .xlam add-in loads disabled | The add-in file carries Mark of the Web | Unblock it or move it to a trusted location |
How to enable macros in one Excel workbook
- Open the workbook. With default settings, Excel shows the yellow SECURITY WARNING bar when the file contains macros.
- Select Enable Content.
- If a Security Warning dialog asks whether to make it a trusted document (Excel asks for files on a network location), select Yes.
The workbook is now a trusted document and opens without the warning, unless you move it. Trust cannot be revoked for one file; the Trusted Documents page of the Trust Center can only clear them all.
You do not need macros to read or edit a file. Microsoft treats an unexpected attachment, or a stranger or pop-up urging you to enable content, as warning signs, and suggests deleting a downloaded file whose macros you cannot vouch for.
Macros blocked from the internet: the red Security Risk bar
Windows adds Mark of the Web to files from the Internet or Restricted sites zones, such as downloads and email attachments, on NTFS drives only. Office then checks, in order: a trusted location, a signature from a publisher whose certificate is on the device, policy, and whether the file was trusted before the change. If none applies, the macros are blocked without your macro setting being read, so switching to Enable VBA macros does not clear the red bar. The block applies only to Office on Windows (Access, Excel, PowerPoint, Project, Publisher, Visio and Word).
Unblock a single file
- Close the workbook.
- In File Explorer, go to the folder where you saved it.
- Right-click the file and choose Properties.
- At the bottom of the General tab, select the Unblock checkbox, then select OK.
- Reopen the workbook. Excel now applies your normal macro setting, which by default means the yellow bar and Enable Content.
The PowerShell cmdlet Unblock-File does the same job by removing the file's Zone.Identifier stream:
Unblock-File -Path "C:\Users\you\Downloads\Report.xlsm"
If there is no Unblock checkbox
- Email attachment: save it to OneDrive before opening it, or save it to your drive and unblock it as above.
- OneDrive, SharePoint or a Teams channel: open it with Open in Desktop App. Files the OneDrive sync client downloads, and files in Desktop, Documents and other Windows known folders synced to OneDrive, do not get Mark of the Web.
- Network share or intranet site: press the Windows key, type Internet Options and open it. On the Security tab, select Trusted sites, then Sites, type the site or server address and select Add. For http addresses or network shares, clear Require server verification (https:) for all sites in this zone. Select Close, then OK. Every file there becomes trusted, so do this only for locations you control.
A share opened by its IP address stays blocked unless it is in Trusted sites or Local intranet, and ticking Unblock does nothing on a share Windows treats as Internet.
To see where Windows thinks a file came from, run notepad Report.xlsm:Zone.Identifier at a command prompt and read the ZoneId line: 3 means Internet (blocked by default) and 2 means Trusted sites (not blocked).
Change macro settings in the Trust Center (Excel for Windows)
- Select File > Options.
- Select Trust Center, then Trust Center Settings.
- Select Macro Settings, choose an option and select OK.
If the Developer tab is showing, Developer > Macro Security (in the Code group) opens the same page. Excel's four options are:
- Disable VBA macros without notification: macros and their alerts are both off.
- Disable VBA macros with notification: the default; you decide file by file from the yellow bar.
- Disable VBA macros except digitally signed macros: signed macros from a trusted publisher run; for a new publisher, you can choose to trust it.
- Enable VBA macros (not recommended, potentially dangerous code can run): everything runs without asking.
Two checkboxes sit on the same page. Enable Excel 4.0 macros when VBA macros are enabled applies your VBA choice to old XLM macros; unticked, XLM macros are disabled without notice. Trust access to the VBA project object model is for developers whose code automates Office, and it is off by default. Changes here apply only to Excel, not to Word or PowerPoint.
Use a trusted location for files you open often
A trusted location is a folder whose files skip the Trust Center checks and do not open in Protected View. Internet files saved there also skip the Mark of the Web check and open with macros enabled. To add one:
- Select File > Options > Trust Center > Trust Center Settings.
- Select Trusted Locations, then Add new location.
- Select Browse, choose the folder, then select OK until every window is closed.
Use a dedicated folder for files you know, never Downloads. Microsoft advises using trusted locations sparingly and does not recommend trusting network locations.
How to enable macros in Excel for Mac
Microsoft's Mac steps cover Excel for Microsoft 365 for Mac, Excel 2024 for Mac and Excel 2021 for Mac:
- Select the Excel menu, then Preferences.
- Select Security.
- Choose Disable all macros with notification (the default, which prompts each time), Disable all macros without notification or Enable all macros.
Microsoft warns that Enable all macros lets good and bad macros run with no further warning. The internet-macro block does not apply on a Mac.
Excel for the web and mobile apps
Excel for the web can open and edit a macro-enabled workbook and keeps its macros, but you cannot create, run or edit VBA there, and it shows no message about them. Select Open in Desktop App above the ribbon to run them. The internet-macro block does not apply to Office on iOS or Android either. For VBA, use desktop Excel on Windows or Mac.
Worked example: test that macros now run
Put this sample data on a blank sheet:
| Cell | A | B |
|---|---|---|
| Row 1 | Region | Sales |
| Row 2 | US | 1200 |
| Row 3 | UK | 950 |
| Row 4 | EU | 700 |
| Row 5 | Total | (the macro fills this) |
Press Alt+F11 to open the Visual Basic for Applications editor, choose Insert > Module, which adds a standard module, and paste:
Sub TestMacros()
Range("B5").Formula = "=SUM(B2:B4)"
MsgBox "Macros are enabled. Total: " & Range("B5").Value
End Sub
Close the editor, press Alt+F8 to open the Macro dialog, select TestMacros and choose Run.
Cell B5 now holds =SUM(B2:B4) and shows 2850 (1200 + 950 + 700), and a message box confirms it.
Save the file as an Excel Macro-Enabled Workbook (.xlsm). If you save it in the standard format, Excel offers a macro-free save; choose No and pick the macro-enabled type, or the macro is lost.
Troubleshooting
- Macro settings cannot be changed: your organisation's group policy may lock them, so contact your IT administrator.
- A signed Excel add-in is still blocked: for .xla and .xlam files with Mark of the Web, trusting the publisher does not help, and Microsoft says this has been so since 2016 (security bulletin MS16-088). Remove Mark of the Web or put the add-in in a trusted location.
- The macro stops when it writes to a cell: the sheet may be protected. Protection applies to macros as well as people unless it was set with the
UserInterfaceOnlyargument. Our guide to locking cells in Excel explains how protection is turned on and off.
- Arrow keys scroll the sheet while you test: see how to turn off Scroll Lock in Excel.
For IT teams and businesses
Microsoft recommends enabling the Block macros from running in Office files from the Internet policy for most users, as part of its security baseline for Microsoft 365 Apps for enterprise. If that is too strict, use the Macro Notification Settings policy (VBA Macro Notification Settings in the other apps) set to disable all except digitally signed macros, with signing by a trusted publisher required.
In the Group Policy Management Console, Excel's copies of both policies sit under User Configuration\Policies\Administrative Templates\Microsoft Excel 2016\Excel Options\Security\Trust Center.
These policies work only with Microsoft 365 Apps for enterprise, not Microsoft 365 Apps for business. Microsoft's service description shows full Group Policy support for Office 365 E3 and E5, but only web-app and privacy policies for Microsoft 365 Business Standard and Business Premium, which matters if you are comparing Business Premium with E3 and E5. Also:
- Deploy trusted publisher certificates centrally rather than letting users add publishers; a trusted publisher is a Windows-wide setting.
- The Site to Zone Assignment List policy can put
https://{your-domain-name}.sharepoint.comin the Trusted sites zone for a team that needs SharePoint macros, but anyone who can upload there then bypasses the block.
- On Macs, set or enforce the
VisualBasicMacroExecutionStatepreference (defaultDisabledWithWarnings) through a configuration profile, for example from Jamf Pro.
- Before tightening policy, list which teams rely on macros from network shares or vendors, and ask vendors to sign their code.
How eCorpIT can help
eCorpIT is a Gurugram-based technology organisation, founded in 2021, assessed at CMMI Level 5 and MSME certified, with senior-led engineering teams working across AWS, Microsoft and Google platforms. Our data and analytics team builds the data pipelines and BI reporting that can take over from fragile, macro-driven spreadsheets. Talk to us at /contact-us/.
Last updated: 15 November 2026.