Expert guide

Excel Macros Blocked: 'The Source of This File Is Untrusted'

Why Office blocks macros in downloaded and emailed files, and how to run trusted ones safely

Short answer: the red "SECURITY RISK: Microsoft has blocked macros from running because the source of this file is untrusted" bar appears because the workbook came from the internet (email, download, some cloud links) and carries a Mark of the Web. For a file you trust: save it locally, close it, right-click → Properties → tick Unblock → OK, and reopen. For internal tools, keep them in a Trusted Location or an internal share recognised as intranet. If you need help across your team, see Excel troubleshooting.

Since Microsoft changed the default in 2022, macro-enabled workbooks that arrive by email or download no longer show an "Enable Content" button. Instead, macros are simply blocked. This stopped a major malware route, and it also stopped many legitimate business tools: the monthly template from head office, the supplier's order form, the macro a consultant emailed. The fix depends on where the file came from and whether you trust it.

What Mark of the Web Is

When a browser or email client saves a file from the internet, Windows attaches a small hidden marker (an alternate data stream called Zone.Identifier) recording that it came from the Internet zone. Office reads that marker. Files from the internet with macros are blocked unless the file has been explicitly unblocked or is opened from a location trusted by policy.

Fix 1: Unblock a Single Trusted File

  • Save the attachment or download to a folder on your PC (not opened from the email preview).

  • Close the workbook if it is open.

  • In File Explorer, right-click the file → Properties.

  • On the General tab, tick Unblock next to the security message, then OK.

  • Open the file and click Enable Content if prompted.

If the workbook arrived inside a ZIP file, unblock the ZIP before extracting; otherwise every extracted file keeps the mark.

PowerShell alternative (for files you trust):
Unblock-File -Path "C:\Users\you\Documents\Monthly Template.xlsm"

For a whole folder of trusted files:
Get-ChildItem "C:\Tools\Templates" -Filter *.xlsm | Unblock-File

Fix 2: Trusted Locations for Your Own Tools

Workbooks your team uses every day should not travel by email. Store them in a folder defined as a Trusted Location (File → Options → Trust Center → Trust Center Settings → Trusted Locations), deployed to everyone by IT. Files opened from a trusted location are allowed to run macros. For network folders, the "Allow Trusted Locations on my network" option must be enabled.

The registry and Group Policy approach is the same as for Access; see setting trusted locations.

Fix 3: Intranet and SharePoint Sources (IT)

  • Files from internal file servers are usually not marked. If they are, adding the server to the Local intranet zone stops them being treated as internet files.

  • Files opened from OneDrive or SharePoint in your own tenant are generally treated differently from internet downloads, but downloading a copy through a browser can still mark it.

  • Group Policy can define how macros in internet files are handled; changing it organisation-wide is a security decision for IT.

Which Situation Are You In?

SituationBest response
Unexpected macro attachmentDo not unblock. Verify with the sender by phone; treat as suspicious
Trusted supplier or head office templateUnblock once, then store in a trusted internal location
Your team's internal tool emailed aroundStop emailing it; host it in a trusted folder or SharePoint
Downloaded template from a websiteUnblock only if you trust the publisher; inspect the VBA first
No Unblock checkbox and still blockedPolicy blocks macros; ask IT

Reduce Your Dependence on Macros

A lot of what macros do in business workbooks is data preparation, which Power Query handles without any macro security issues because it works in ordinary .xlsx files. Moving those steps out of VBA means fewer blocked files and less support. The decision guide is in Power Query vs VBA, and cloud automation without VBA in Office Scripts vs VBA.

Before You Unblock: Check the Code

  • Open the VBA editor (Alt+F11) with macros still disabled and read the modules.

  • Look for code that runs on open (Workbook_Open, Auto_Open).

  • Be wary of Shell, CreateObject("WScript.Shell"), URLDownloadToFile, or obfuscated strings.

  • If in doubt, do not enable it; ask someone who reads VBA.

AI can help explain unfamiliar macro code before you trust it; see using AI with Excel VBA.

FAQ

Blocked Excel macros FAQ

Mark of the Web, unblocking and policy

Windows marks files that arrive from the internet, including email attachments and downloads, with a Mark of the Web. Office blocks macros in those files by default to stop malicious attachments. The workbook opens, but its VBA does not run and there is no Enable Content button.

Save the file to a local folder, close it, right-click the file in File Explorer, choose Properties, tick Unblock on the General tab and click OK. Reopen the file; you can then enable content as normal. Only do this for files from a source you trust.

The file may not carry a Mark of the Web (so the block is from policy instead), it may be inside a ZIP that was not unblocked before extraction, or it is on a location where the property is not shown. Check with your IT team whether a Group Policy blocks macros entirely.

Files on internal network shares are usually not marked as internet files. If they are, IT can add the internal server to the Local intranet zone or define Trusted Locations, so internal workbooks are not treated as internet content.

No. The block exists because macro-enabled attachments are a common route for malware. Unblock only files from known senders, ideally confirmed through a separate channel, and keep macro-heavy business tools in trusted internal locations rather than emailing them.