Excel "Microsoft has blocked macros from running": how to fix it
Windows marked the workbook as coming from the internet (Mark of the Web), so Excel blocks its VBA macros and hides the Enable Content button. If you trust the file, close it. Then right-click it in File Explorer, choose Properties, tick Unblock on the General tab, click OK and reopen it. Files on a network share may need a Trusted Location or Trusted Sites entry.
What this message means
Windows adds a hidden tag called Mark of the Web to files that come from the internet or the Restricted sites zone. Browser downloads and email attachments both get it. Since 2022, Microsoft 365 Excel on Windows blocks VBA macros in any file with that tag. You see a red SECURITY RISK bar with a Learn More button, and there is no Enable Content button. The workbook still opens and you can view and edit the data, but buttons, forms and anything else that uses macros will not run. The block is a security default, not a sign that the file is damaged. It lifts when the tag is removed or the file sits in a location Excel trusts.
Common causes
| Cause | How to tell |
|---|---|
| The file was downloaded in a browser or saved from an email attachment, so Windows tagged it with Mark of the Web (Zone 3, Internet). | Right-click the file and choose Properties. At the bottom of the General tab, a Security line says "This file came from another computer and might be blocked to help protect this computer" and has an Unblock checkbox. |
| The workbook came out of a ZIP file that was downloaded and then extracted with the File Explorer Extract All option. The extracted files inherit the ZIP's Mark of the Web. | Every macro file from the same ZIP shows the red bar, and the ZIP itself also shows the Unblock checkbox in its Properties. |
| The file is on a network share that Windows treats as the Internet zone. This is common when the share is opened by IP address (for example \\192.168.1.20\Finance) or by a fully qualified name that isn't in the Local intranet zone. | The file path starts with \\ or a mapped drive letter. Properties has no Unblock checkbox, or ticking it changes nothing. |
| The file was downloaded from OneDrive, SharePoint or a Teams channel in a web browser instead of being opened with Open in Desktop App or synced. | The workbook is in your Downloads folder and its name may carry a (1) suffix, even though the original lives on SharePoint or OneDrive. |
| The file is a macro-enabled add-in (.xlam, .xla) or template (.xltm, .xlt) that came from the internet. | The add-in appears under File > Options > Add-ins but loads disabled, or new workbooks created from the template show the red bar. |
| Your organization has set the "Block macros from running in Office files from the Internet" or "Macro Notification Settings" policy. | Macro options under File > Options > Trust Center > Trust Center Settings > Macro Settings are greyed out with a note that your system administrator manages the setting. |
How to fix it
1. Unblock the file in its Properties
Excel for Microsoft 365, Excel 2021 and 2024 on Windows 10 and Windows 11
- Close the workbook in Excel. The change is not picked up while the file is open.
- In File Explorer, go to the folder that contains the file.
- Right-click the file and choose Properties. On Windows 11 you can also select the file and press Alt+Enter.
- On the General tab, find the Security section at the bottom and tick Unblock.
- Click OK, then reopen the file. Macros now run, or you get the normal yellow bar with Enable Content, depending on your macro settings.
2. Unblock the ZIP before extracting it
Windows 10 and Windows 11
- Delete the files you already extracted from the ZIP.
- Right-click the downloaded .zip file, choose Properties, tick Unblock on the General tab and click OK.
- Right-click the ZIP again, choose Extract All, and extract it.
- Open the workbook from the newly extracted folder.
3. Unblock one file or a whole folder with PowerShell
Windows PowerShell 3.0 or later (built into Windows 10 and 11)
- Close the workbooks in Excel.
- Press the Windows key, type PowerShell and open Windows PowerShell.
- For one file, run: Unblock-File -Path "C:\Users\YourName\Downloads\Report.xlsm"
- For every Excel file in a folder, run: Get-ChildItem "C:\Reports" -Recurse -Include *.xlsm,*.xlsb,*.xls,*.xlam | Unblock-File
- Reopen the workbooks. Only do this for files whose source you trust.
4. Save recurring macro files to a Trusted Location
Excel for Microsoft 365, Excel 2019, 2021 and 2024 on Windows
- In Excel, go to File > Options > Trust Center and click Trust Center Settings.
- Select Trusted Locations, then click Add new location.
- Click Browse, pick a dedicated folder (for example C:\TrustedMacros) and tick Subfolders of this location are also trusted if you need it. Click OK.
- For a network folder, first tick Allow Trusted Locations on my network (not recommended) on the same page.
- Click OK twice. Save or move the macro workbooks into that folder and open them from there.
5. Trust the network share or intranet site
Files opened from a file server or intranet website on Windows 10 and Windows 11
- Close Excel.
- Press the Windows key, type Internet Options and open it.
- On the Security tab, select Trusted sites and click Sites.
- Type the server address (for example file://192.168.1.20 or file://fileserver.corp.example.com) and click Add. For a file share or http:// address, first clear Require server verification (https:) for all sites in this zone.
- Click Close, then OK, and reopen the file from the share.
6. Open SharePoint, OneDrive and Teams files in the desktop app
Microsoft 365 files stored in OneDrive, SharePoint or Teams
- Open the workbook in the browser from OneDrive, SharePoint or the Teams Files tab.
- Choose Editing > Open in Desktop App (in Teams: the ... menu > Open in app).
- Excel opens the file without Mark of the Web and macros run under your normal settings.
- Alternatively, sync the library with the OneDrive client. Synced files don't get the tag.
Next time, skip the search
Crade is an AI assistant for Mac and Windows that sees your screen. When a message like this pops up, ask “what does this mean?” and it explains the exact error in front of you, step by step.
Download CradeStill not fixed?
If the Unblock checkbox is missing and the file isn't on a network share, copy the workbook into a local Trusted Location and open it from there. If the Trust Center options are greyed out, or unblocking has no effect, a policy is controlling macros. Send your IT administrator the file path and a screenshot of the red bar. They can add the location to Trusted Sites through the "Site to Zone Assignment List" policy, sign the macros with a trusted publisher certificate, or make an exception. If the file came from a person or website you don't recognize, leave it blocked and ask the sender for a copy you can confirm.
Questions people ask
Why is there no Enable Content button?
For files with Mark of the Web, Excel replaces the old yellow Enable Content bar with the red SECURITY RISK bar, which has no way to enable macros. You have to unblock the file in its Properties or open it from a Trusted Location.
Will choosing "Enable VBA macros" in the Trust Center fix it?
No. Macro Settings under File > Options > Trust Center are checked only after the internet block, so files from the internet stay blocked. That setting also exposes every other workbook to harmful macros, so leave it at the default.
Why doesn't the Unblock checkbox show up in Properties?
The file either has no Mark of the Web, or it's on a network share that Windows treats as the Internet zone. For a share, add the server to Trusted sites or copy the file to a local Trusted Location.
Does this happen in Excel for Mac or Excel on the web?
No. Microsoft says this block applies only to Office on Windows. Excel for Mac, iOS, Android and the web don't show this banner, though Excel for the web doesn't run VBA macros at all.
Is it safe to unblock the file?
Only if you know where the file came from and expected it to contain macros. Macros in email attachments and downloads are a common way to spread malware, which is why Microsoft blocks them by default.
Sources
- Macros from the internet are blocked by default in Office (Microsoft Learn)
- A potentially dangerous macro has been blocked (Microsoft Support)
- Unblock-File (Microsoft Learn, PowerShell)
- How to fix "Microsoft has blocked macros" (Excel Off The Grid)
- Excel #CALC! error: what it means and how to fix it
- Excel can't insert new cells (push non-empty cells off worksheet): fix
- Excel "There are one or more circular references": how to fix
- Excel #DIV/0! error: what it means and how to fix it
- Excel "file format or file extension is not valid": how to fix it
- Excel "file is locked for editing by another user": how to fix it