Skip to content
iBlockSpam
Phishing & threats

Why does Office block macros in files from the internet?

By iBlockSpam Team How we check our guides Updated 9 min read 6 sources
Short answer

Since 2022, Microsoft 365 Apps on Windows block VBA macros in files that carry Mark of the Web, such as email attachments and downloads, and show a SECURITY RISK banner with no Enable Content button. Microsoft made the change because malicious macros were a common route for malware and ransomware. Admins can allow trusted macros with signing, trusted sites or Trusted Locations.

For years, a malicious Word or Excel attachment only needed one click on Enable Content to run its code. Microsoft changed that in 2022: Office on Windows now blocks VBA macros in files that came from the internet. This guide explains what changed, what users see, why attackers moved to other file types, and how admins can let trusted macros through without undoing the protection.

What did Microsoft change?

Microsoft announced the change on the Microsoft 365 Blog on February 7, 2022: "VBA macros obtained from the internet will now be blocked by default." Users "will no longer be able to enable content with a click of a button".

The reason was simple. Microsoft's admin documentation says "VBA macros are a common way for malicious actors to gain access to deploy malware and ransomware." In the announcement, Office security engineering added that malicious code usually arrives in a document that "originates from the internet (email attachment, link, internet download, etc.)."

When did it take effect?

The rollout wasn't smooth. Microsoft paused it on July 8, 2022 "following user feedback", then said on July 20, 2022: "We're resuming the rollout of this change in Current Channel." According to Microsoft Learn, the change reached Access, Excel, PowerPoint, Visio and Word on these dates:

Update channel Version Date
Current Channel (Preview) 2203 Started rolling out April 12, 2022
Current Channel 2206 Started rolling out July 27, 2022
Monthly Enterprise Channel 2208 October 11, 2022
Semi-Annual Enterprise Channel (Preview) 2208 October 11, 2022
Semi-Annual Enterprise Channel 2208 January 10, 2023

Publisher followed on February 14, 2023, and Project on August 13, 2024.

Which apps and platforms are covered?

The change "only affects Office on devices running Windows" and the apps Access, Excel, PowerPoint, Project, Publisher, Visio and Word. Microsoft says it "doesn't affect Office on a Mac, Office on Android or iOS devices, or Office on the web."

The version table covers Microsoft 365 Apps update channels. The 2022 announcement said Microsoft planned to bring the change to Office LTSC, Office 2021, Office 2019, Office 2016 and Office 2013 "at a future date to be determined". If you still run a perpetual version, test how it behaves rather than assuming it matches Microsoft 365 Apps.

What does the SECURITY RISK banner mean?

When someone opens a macro-enabled file from the internet, Office shows a SECURITY RISK message bar. Microsoft's support article gives its warning text: "Microsoft has blocked macros from running because the source of the file is untrusted." There's a Learn More button but no Enable Content button.

That's the key difference from the old SECURITY WARNING bar, which let users run the macros with one click. Microsoft's advice to users is blunt: "If a downloaded file from the internet or a file opened from a network share wants you to allow macros, and you're not certain what those macros do, you should probably just delete that file."

If an administrator has restricted macros, users may see a different message instead: "Your administrator has restricted the use of macros in your organization."

What is Mark of the Web?

Mark of the Web (MOTW) is how Office knows a file came from the internet. Windows adds it to files from untrusted locations, "such as the internet or Restricted Zone", for example browser downloads and email attachments. It's stored as a hidden Zone.Identifier stream on the file, with a ZoneId value:

ZoneId Zone Macros blocked by default?
0 My Computer No
1 Local intranet No
2 Trusted sites No
3 Internet Yes
4 Restricted sites Yes

Microsoft notes two limits. MOTW "only applies to files saved on an NTFS file system, not files saved to FAT32 formatted devices." And it depends on the tool that saved the file setting it in the first place.

How Office decides whether to run a macro

Microsoft Learn describes the order of checks for a file with MOTW:

  1. Is the file in a Trusted Location? If so, macros run.
  2. Are the macros digitally signed by a publisher the device trusts? If so, they run.
  3. Does a policy block or allow macros? If so, the policy wins.
  4. Did the user enable this file's content before the change, making it a Trusted Document? If so, macros run.
  5. Otherwise, macros are blocked and the SECURITY RISK banner appears.

The order matters. Trusted Locations and trusted publishers are checked first, so they bypass the internet block entirely.

Why did attackers move to other file types?

Because the old trick stopped working. The block depends on Mark of the Web, so attackers looked for file types that don't carry it through to the file the user finally opens, such as archive and disk-image containers, or that aren't Office documents at all, such as Windows shortcut (LNK) files. Microsoft's Q1 2026 email threat report says threat actors still "commonly use ZIP files to circumvent Mark of the Web (MOTW) protections."

OneNote files were another detour. Microsoft later added a OneNote block on embedded files with dangerous extensions, starting with Version 2304 in 2023.

The bigger shift was away from malware attachments altogether. In the same Q1 2026 report, Microsoft says "Traditional malware delivery continued its long-term decline, representing just 5–6% of payloads by the end of the quarter", while credential phishing dominated. HTML attachments were the leading file type in January 2026 at 37% of payloads. Our guide to dangerous email attachment types covers what to block and quarantine now, and HTML attachment phishing explains the most common replacement.

What should users do when a macro is blocked?

  1. Ask whether you expected the file. If it's an unexpected invoice, order or "secure document", don't try to unblock it. Report it.
  2. Check with the sender by phone if it's from someone you know. Their mailbox may be compromised, so don't reply to the email to ask.
  3. Look at what you need. Many files open and read fine without their macros. If you only need to read it, you're done.
  4. Ask IT before unblocking anything from outside the company. A legitimate business process can be set up to work safely.

To unblock a file you truly trust, Microsoft's method is to right-click it, choose Properties, and select Unblock on the General tab. Admins can do the same with the PowerShell Unblock-File cmdlet. Both remove MOTW from that one file.

How do admins manage the macro block?

Policies

Microsoft recommends enabling Block macros from running in Office files from the Internet as part of the security baseline for Microsoft 365 Apps for enterprise. There's a separate policy per app, under the app's Trust Center settings in User Configuration. Before the default change, this policy was the only way to get the block. Now Not Configured behaves the same as Enabled, but setting it explicitly protects you if defaults ever shift.

For users who need macros at all, Microsoft's baseline is the VBA Macro Notification Settings policy set to "Disable all except digitally signed macros" with "Require macros to be signed by a trusted publisher". For users who don't need macros, Microsoft says to choose "Disable all without notification."

You can deploy these with Cloud Policy in the Microsoft 365 Apps admin center, Microsoft Intune or Group Policy.

One catch for small businesses: Microsoft says "You can only use policies if you're using Microsoft 365 Apps for enterprise. Policies aren't available for Microsoft 365 Apps for business." On business plans, users get the default block and manage exceptions file by file.

Safer ways to allow trusted macros

Scenario Microsoft's suggested approach Caveat
A vendor's macros Ask them to sign the code; deploy their certificate as a trusted publisher Any macro validly signed with that certificate will run, and trusted publishers are a Windows-wide setting
Files on an internal file server Add it to Trusted sites or the Local intranet zone Trusting a site gives it elevated permissions beyond Office; control who can save files there
Files on OneDrive or SharePoint Use Open in Desktop App, or let the OneDrive sync client download them Browser downloads may get MOTW, depending on zone settings
Recurring reports saved locally Save them to a Trusted Location Microsoft says to use Trusted Locations "sparingly"
Excel add-ins (.xla, .xlam) Remove MOTW or use a Trusted Location Microsoft doesn't list code signing as an option for Excel add-ins that have MOTW

Trusted Locations: use with care

A Trusted Location skips the MOTW check. Microsoft Learn: "Saving files from the internet to a Trusted Location on a user's device ignores the check for Mark of the Web and opens with VBA macros enabled." That's convenient, and it's also an obvious target. Avoid these mistakes:

  • Making the Downloads folder or Desktop a Trusted Location. Every attachment a user saves would then run its macros.
  • Trusting network locations. Microsoft says network locations can be Trusted Locations, "but it's not recommended."
  • Adding a SharePoint site everyone can write to as a Trusted site. It isn't a Trusted Location, but it has a similar effect. Microsoft warns that "Anyone with permissions to add files to SharePoint could add files with active content, such as macros."
  • Letting users add their own. Manage Trusted Locations and trusted publishers centrally, and review them.

Do you still need to filter macro attachments?

Yes. The Office block is a strong last line, but it has gaps. It's Windows-only, it depends on MOTW being present, users can still remove MOTW, and older or unmanaged installs may behave differently. The CISA, NSA, FBI and MS-ISAC phishing guidance recommends "Block macros by default" and asks vendors to "Include mechanisms that block macros by default with email products."

A gateway rule stops the file before anyone has to make a decision. iBlockSpam includes a Microsoft Office macro filter among its attachment-type filters, and held messages go to each user's quarantine with digest emails, where an admin can release a genuine file after checking it.

Next steps

  • Confirm the default block is in place: open a test macro file downloaded from the internet on a managed Windows PC and look for the SECURITY RISK banner.
  • If you have Microsoft 365 Apps for enterprise, set Block macros from running in Office files from the Internet to Enabled explicitly.
  • Audit Trusted Locations and trusted publishers. Remove anything that covers Downloads, Desktop or a broadly writable share.
  • Block or quarantine macro-enabled attachments at the gateway, and review your rules for ZIP, ISO, LNK and HTML files too.
  • Read how to spot a phishing email and share the "don't unblock unexpected files" rule with staff.

Frequently asked questions

Why can't I enable macros in an Excel file from email?

Because the file came from the internet. Windows tags email attachments and downloads with Mark of the Web, and Microsoft 365 Apps block VBA macros in those files by default. You see a SECURITY RISK banner instead of an Enable Content button. Only remove the block if you trust the file's source and know what the macros do.

How do I unblock macros in a file I trust?

Save the file, right-click it in File Explorer, choose Properties, and select Unblock on the General tab. That removes Mark of the Web, and the macros can run unless a policy blocks them. Microsoft's support article says that if you aren't certain what a file's macros do, you should probably just delete the file.

Does the macro block apply to Office on a Mac or Office on the web?

No. Microsoft says the change only affects Office on Windows, in Access, Excel, PowerPoint, Project, Publisher, Visio and Word. It doesn't affect Office on a Mac, Office on Android or iOS, or Office on the web.

Can a small business change the macro policy without Group Policy?

Microsoft says the macro policies are only available with Microsoft 365 Apps for enterprise, not Microsoft 365 Apps for business. Business-plan users get the default block, and can trust files individually by removing Mark of the Web or saving them in a Trusted Location. Enterprise customers can set policies through Cloud Policy, Intune or Group Policy.

Are macro-enabled attachments still dangerous?

Less common, but yes. The block depends on Mark of the Web, applies only to Office on Windows, and users can still remove it. Older or unmanaged installs may behave differently. Keep filtering macro-enabled attachments at the gateway, and quarantine them if some teams genuinely exchange them with partners.

Sources

  1. Microsoft Learn: Macros from the internet are blocked by default in Office
  2. Microsoft 365 Blog: Helping users stay safe: Blocking internet macros by default in Office (February 2022, updated July 2022)
  3. Microsoft Support: A potentially dangerous macro has been blocked
  4. Microsoft Learn: OneNote blocks embedded files that have dangerous extensions
  5. Microsoft Threat Intelligence: Email threat landscape, Q1 2026 trends and insights
  6. CISA, NSA, FBI and MS-ISAC: Phishing Guidance: Stopping the Attack Cycle at Phase One (October 2023)

See how your domain measures up

Run a free Email Health Check: MX, SPF, DKIM, DMARC and transport security in one scan, with the raw records shown. No sign-up.

Keep reading