|

How To Fix Microsoft Has Blocked Macros In Excel And Word (2026)

You opened a Word or Excel file and a red SECURITY RISK bar says Microsoft has blocked macros from running because the source of the file is untrusted.

There is no Enable Content button, and that is a deliberate change by Microsoft, not a fault on your PC.

If you trust the file, you can unblock it in under a minute with the steps below.

Quick answer: how to unblock a macro file

SituationWhat to do
One file you downloaded or got by emailRight-click it > Properties > tick Unblock > OK
A whole folder of files you trustMake the folder a Trusted Location
File on a network shareAdd the share as a Trusted site or to the Local intranet zone
File on OneDrive or SharePointChoose Open in Desktop App
Work PC, no Unblock boxAsk your IT administrator

Why does Office block the macros?

Windows adds a Mark of the Web to files that come from the internet, browser downloads and email attachments.

Office now blocks VBA macros in any file that carries that mark.

Microsoft made the change because macros are a common way for attackers to deliver malware and ransomware.

Before the change you saw a SECURITY WARNING bar with an Enable content button, and now you see the SECURITY RISK bar with a Learn More button only.

Which apps does it affect?

AffectedNot affected
Office on Windows: Access, Excel, PowerPoint, Project, Publisher, Visio, WordOffice on Mac, Android, iOS and Office on the web
Files with the Mark of the WebPerpetual versions such as Office 2019 and Office LTSC 2021 keep the old default behavior

Make sure the file is safe first

Only unblock a file from a person or company you know and expected to hear from.

A macro can run code on your PC, which is the reason Microsoft blocks them.

If you are not sure who sent it, do not unblock it.

Method 1: Unblock a single file in Properties

  1. Close the file in Word or Excel.
  2. Open File Explorer and right-click the file.
  3. Select Properties.
  4. On the General tab, tick Unblock.
  5. Select OK, then open the file again.

This removes the Mark of the Web from that one file only.

If the Unblock box is not there, the file is probably on a network share, so use Method 3.

Method 2: Use PowerShell to unblock a file

Microsoft lists an equivalent command that does the same thing as the Unblock box.

Open PowerShell and run this, with your own file path:

Unblock-File -Path "C:\path\to\file.xlsm"

The command removes the ZoneId value, which is what the Unblock box removes.

Method 3: Fix a file on a network share

Files on a share that is not in the Local intranet zone or Trusted sites also get their macros blocked.

Microsoft gives the example of a share opened by its IP address.

The fix is to add the location as a Trusted site or add it to the Local intranet zone.

Microsoft recommends Trusted sites over Local intranet.

Selecting Unblock has no effect if the share is in the Internet zone.

On a work PC these zone settings are often set by your administrator.

Method 4: Open OneDrive or SharePoint files in the desktop app

For a file stored in OneDrive or SharePoint, including a Teams channel site, choose Open in Desktop App.

Microsoft says files opened this way do not get the Mark of the Web.

A file that the OneDrive sync client downloads for you does not get it either.

Method 5: Make a folder a Trusted Location

Use this when you have a group of trusted files in one folder on your PC.

  1. Open the app and go to File > Options > Trust Center.
  2. Select Trust Center Settings, then Trusted Locations.
  3. Select Add new location.
  4. Select Browse, choose the folder and select OK.
  5. Select OK in each open dialog until they close.

Microsoft says files in a trusted location skip the Mark of the Web check entirely, so use this sparingly.

Avoid network locations for this, and never pick a folder such as Downloads where unknown files land.

What about macro templates and add-ins?

File typeOfficial fix on a local PC
Templates: .dot, .dotm, .pot, .potm, .xlt, .xltmRemove the Mark of the Web, or save to a Trusted Location
PowerPoint add-ins: .ppa, .ppamRemove the mark, sign and trust the publisher, or save to a Trusted Location
Excel add-ins: .xla, .xlamRemove the mark, or save to a Trusted Location (digital signatures do not work while the mark is present)

Why are macros still blocked after I unblocked the file?

  • The file was re-downloaded. A fresh copy gets the Mark of the Web again, so unblock the new copy.
  • The file is on a share in the Internet zone. Unblock has no effect there, so use a Trusted site.
  • Your organization controls the setting. Microsoft offers a policy for IT teams that blocks macros in files from the internet, so ask your IT team.

What about signed macros?

A digital signature confirms who signed the macro and that it has not been altered.

Under the setting Disable all macros except digitally signed macros, a signed macro from a publisher you already trust can run.

A signed macro from an untrusted publisher triggers a notification instead.

Office trusts a self-signed certificate only on the computer that holds it, so a file signed that way will not carry over to other PCs.

Check your macro security setting

Go to File > Options > Trust Center > Trust Center Settings > Macro Settings.

Microsoft’s default there is Disable all macros with notification.

Microsoft says the Enable all macros option is not recommended because it lets potentially dangerous code run.

Related Office fixes: Word Protected View and read-only, Excel file locked for editing and Excel formulas not calculating.

Official sources

Leave a Reply

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