โ† Back to Error Directory

"We Can't Run This Macro" โ€” Excel Macro Security Blocked Fix

This isn't a bug โ€” it's Excel deliberately protecting you. Here's how to safely tell it a specific file is okay.

Table of Contents

1. This Block Is Intentional, Not a Malfunction

Unlike every other issue on this site, macro security blocking is not something to "fix" in the sense of correcting a mistake โ€” it's Excel's built-in protection working exactly as designed. Macros are executable code, and malicious macros are a well-documented method of delivering malware through spreadsheet attachments. Excel's default behavior is to disable macros in any file it can't confirm is trustworthy, which is the correct default for the vast majority of users.

2. Understanding "Mark of the Web"

When you download a file from the internet, or receive it as an email attachment, Windows silently attaches a hidden metadata flag called the "Mark of the Web" (MOTW) to that file. This flag isn't visible in File Explorer under normal viewing, but Excel checks for it automatically. Any file carrying this flag is treated as originating from an untrusted zone, and its macros are disabled by default regardless of the Trust Center's general macro settings.

3. Interactive Demo: File Origin Simulator

See how the same macro-containing file behaves differently depending on how it arrived on your computer.

4. The Safest Fix: Unblock the Specific File

This is the recommended approach when you're confident a specific file is safe:

  1. Close the file in Excel if it's currently open.
  2. In File Explorer, right-click the file and select Properties.
  3. On the General tab, look near the bottom for a security notice reading "This file came from another computer and might be blocked to help protect this computer."
  4. Check the Unblock checkbox next to that notice, then click OK.
  5. Reopen the file in Excel โ€” macros should now be available without the security warning.

This method is narrowly scoped to the one file you've explicitly reviewed and trusted, without changing Excel's general security posture for any other file.

5. Trust Center Macro Settings Explained

Accessible via File โ†’ Options โ†’ Trust Center โ†’ Trust Center Settings โ†’ Macro Settings, Excel offers four levels:

SettingBehavior
Disable all macros without notificationMacros never run, and you're not even shown a warning โ€” most restrictive
Disable all macros with notificationThe default setting โ€” macros are blocked, but a warning bar lets you enable them for that session
Disable all macros except digitally signed macrosOnly macros signed by a trusted publisher certificate run automatically
Enable all macrosAll macros run without any warning โ€” strongly discouraged, see section 8

6. Using Trusted Locations for Recurring Files

If you regularly work with internal, self-authored macro files (like your own automation tools), designate a specific folder as a Trusted Location rather than repeatedly unblocking individual files:

  1. Go to File โ†’ Options โ†’ Trust Center โ†’ Trust Center Settings โ†’ Trusted Locations.
  2. Click Add new location and select a folder you control.
  3. Any file placed in that folder will have macros enabled automatically, without security warnings.

Only add folders you fully control and that aren't accessible to untrusted sources (like a shared downloads folder), since anything placed there bypasses macro security entirely.

7. Digitally Signed Macros

For organizations distributing macros internally at scale, digitally signing the VBA project with a trusted certificate allows the "Disable all macros except digitally signed macros" Trust Center setting to work smoothly โ€” signed macros from a recognized publisher run automatically, while unsigned or differently-signed macros remain blocked. This requires setting up a code-signing certificate, typically through an organization's IT department using either a purchased commercial certificate or an internal certificate authority.

8. What Not to Do: Enabling All Macros Globally

It's tempting to simply select "Enable all macros" in the Trust Center to make the warnings stop permanently โ€” this is strongly discouraged. This setting doesn't just trust the one file currently giving you trouble; it removes macro security for every single file you'll ever open afterward, including any malicious file you might encounter later without realizing it. Always prefer the narrowly-scoped Unblock method or a specific Trusted Location instead.

9. Frequently Asked Questions

Why does Excel say it can't run a macro?

This is Excel's Trust Center security feature blocking macros by default, particularly for files downloaded from the internet or received as email attachments, which carry a hidden Mark of the Web flag identifying them as originating from an untrusted location.

How do I safely enable macros for a file I trust?

Right-click the file in File Explorer before opening it, select Properties, and check Unblock at the bottom of the General tab if present, then click OK. This removes the Mark of the Web flag entirely, allowing Excel to treat the file as a local trusted file rather than an internet download.

Should I enable all macros permanently in Excel's Trust Center?

No, this is strongly discouraged as a general setting because it removes protection against genuinely malicious macros in any file you open, not just the one you currently trust. Use the Unblock file method or a designated Trusted Location folder instead, which apply security exceptions more narrowly.

Related Guides

Editorial Disclaimer: This guide is developed to the best of our domain knowledge and tested against Excel 2019+, Microsoft 365, and Google Sheets. Content is updated continuously as spreadsheet calculation engines evolve.