“Microsoft has blocked macros from running because the source of this file is untrusted”: fix

Quick answer: Office shows this red bar when a macro file carries Windows’ internet marker, the Mark of the Web. If you trust the file and who sent it, close it, right-click it in File Explorer, choose Properties, tick Unblock on the General tab, select OK and open it again. For a folder of files you use every week, a Trusted Location is the better fix. Don’t switch on Enable all macros; it doesn’t remove this block anyway and it leaves every file unprotected.

Why Office blocks the macros

The full bar reads SECURITY RISK: Microsoft has blocked macros from running because the source of this file is untrusted. Unlike the older yellow SECURITY WARNING bar, it has no Enable Content button, so nothing inside the app will switch the macros on. The fix happens in File Explorer or in Trust Center settings.

According to Microsoft Learn, Office on Windows has blocked VBA macros in files from the internet by default since 2022, starting with Current Channel version 2206 and reaching Semi-Annual Enterprise Channel with version 2208 in January 2023. It covers Access, Excel, PowerPoint, Visio and Word, and later Project and Publisher. Office for Mac, the web and mobile apps don’t use this block.

When you open a file with macros, Office checks a few things in order:

  1. Does the file carry the Mark of the Web? If not, normal macro settings apply.
  2. Is it saved in a Trusted Location? If so, the macros run.
  3. Is the macro signed by a publisher you’ve already trusted? If so, it runs.
  4. Has your organization set a policy that allows or blocks it?
  5. Was it a trusted document before the block arrived? Only then does it open as before.

If none of these apply, Office shows the SECURITY RISK bar. The marker is added by browsers and email apps when you save a download or an attachment, and Windows only stores it on NTFS drives.

Before you unblock anything

Macro files from the internet are one of the most common ways malware gets onto PCs, which is why Microsoft made this the default. Microsoft’s own advice is to delete files from unknown senders that ask you to enable macros. Before unblocking, check that you expected the file, that it came from someone you know, and that it actually needs macros. An invoice or a delivery notice that insists on macros is a warning sign. If you’re unsure, scan it first; see how to scan for malware on Windows.

Fix for one file: Unblock

  1. Save the file to a folder on your PC, such as Documents, and close it in Office.
  2. In File Explorer, right-click the file and choose Properties. On Windows 11 the full menu may sit under Show more options.
  3. On the General tab, find Security at the bottom and tick Unblock.
  4. Select Apply and OK, then open the file again.

If your macro settings are on the default, Office may now show the yellow Enable Content bar instead, which you can accept for this file. PowerShell’s Unblock-File does the same job and can handle several files you’ve checked:

Get-ChildItem "$env:USERPROFILE\Documents\Reports\*.xlsm" | Unblock-File

Pick the fix for where the file came from

Where the file came fromBest fix
Email attachment or browser downloadSave it, then Unblock it as above. Opening an attachment straight from Outlook keeps the marker.
ZIP or other archiveUnblock the .zip file before you extract it. Windows’ built-in extraction copies the marker onto every file inside; some third-party tools may not.
OneDrive or SharePointUse Open in Desktop App from the web, or open it from your synced OneDrive folder. Microsoft says neither adds the marker; a copy you download through the browser may.
Network share or NASAdd the server to the Local intranet or Trusted sites zone (below). The Unblock box usually isn’t there for these files.
Files you use every weekMove them into a Trusted Location subfolder (below).
Excel add-in (.xla, .xlam)Unblock it or put it in a Trusted Location. A digital signature doesn’t help a downloaded Excel add-in.

Add a Trusted Location. In Excel or Word, go to File > Options > Trust Center > Trust Center Settings > Trusted Locations, select Add new location, browse to a dedicated folder and select OK. Every macro in that folder then runs without a prompt, so use a narrow folder such as Documents\Macros, never your whole Downloads folder, Documents folder or a drive root. Network folders also need Allow Trusted Locations on my network ticked, which Microsoft doesn’t recommend; zone settings are the safer route for shares. Each Office app keeps its own list.

Trust a network share. Press Win + R, run inetcpl.cpl, open the Security tab, choose Local intranet (or Trusted sites), then Sites and Advanced, and add the server, for example \\fileserver or file://192.168.1.20. For Trusted sites you may need to clear Require server verification (https:) for all sites in this zone to add a share or http address. Only add servers you control, because this relaxes protection for every file on them. If the share won’t open at all, see “block unauthenticated guest access”.

Still blocked after unblocking?

  • No Unblock box: the file has no marker to remove, or it’s on a share. Check the zone with notepad file.xlsm:Zone.Identifier in Command Prompt; ZoneId=3 means Internet. If nothing opens, the block comes from somewhere else in this list.
  • Your work PC: if IT has set the policy Block macros from running in Office files from the Internet, only IT can allow the file, usually through a trusted publisher or a Trusted Location they manage.
  • Different message: a red BLOCKED CONTENT bar about ActiveX controls, or a Microsoft Excel Security Notice about an XLL add-in, are separate protections with their own settings. Unblocking won’t change them.
  • Still open in Office: the file must be closed while you unblock it, and opened again afterwards. A copy in Recent files may point to the old download.
  • On a Mac: this bar is a Windows feature. Mac guides that tell you to choose Enable all macros are solving a different problem and weaken security.

Some guides suggest copying files to a FAT32 USB drive to strip the marker, or turning off zone information for all attachments. Both remove protection more widely than you need, so stick to unblocking the files you trust. The same marker is behind File Explorer’s preview warning, covered in “the file you are attempting to preview could harm your computer”.

For admins

Microsoft recommends signing internal macros and trusting the publisher, or managing Trusted Locations centrally, rather than asking users to unblock files. The Group Policy setting lives at User Configuration > Policies > Administrative Templates > Microsoft Excel 2016 > Excel Options > Security > Trust Center (with matching paths for Word, PowerPoint and the other apps). Learn notes this policy works with Microsoft 365 Apps for enterprise; check the page for your edition and channel before relying on it.

Once the macros run, these Excel tips can save more time than many simple macros.

Official sources

How we write our guides: read our editorial policy.

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *