Excel blocks macros because of its Trust Center security settings, and the fix is to either enable macros for that single file (the yellow security warning bar) or add the file's folder to Excel's Trusted Locations so it stops asking every time. Files downloaded from the internet also carry a Windows or macOS "mark of the web," which ignores your macro settings and opens the workbook in Protected View until you confirm the source. Work through the steps below in order, from least permanent to most, and you will not have to lower Excel's overall security just to run a workbook you trust.

What You'll Need

  • The workbook itself, saved to a local or network folder you control (not directly inside a compressed ZIP or email attachment).
  • Excel on Windows or macOS, plus permission to change Trust Center settings (some managed work or school PCs block this by policy).
  • A way to confirm the file came from a source you trust. Never enable macros on a file you did not expect or cannot verify, since macro viruses are still a real vector.

Step-by-Step

Menu labels in Excel can differ slightly by version, platform and region, so if a name below looks different on your machine, look for the closest match.

  1. Close and reopen the file from a normal folder. If you opened the workbook straight from an email attachment or from inside a ZIP file, Windows marks it as untrusted and Excel may refuse to run macros no matter what. Save the file to a folder such as Documents first, then open it from there.
  2. Look for the yellow security warning bar. When a workbook with macros opens, Excel usually shows a bar under the ribbon saying macros have been disabled. Click Enable Content to allow macros for this session. This is the safest option: it trusts only this file, and the setting is forgotten when you close it.
  3. Check Protected View. If the title bar says Protected View and the ribbon is mostly greyed out, click Enable Editing first. Macros cannot run while a file is in Protected View.
  4. Remove the mark of the web (Windows). Right-click the workbook in File Explorer and choose Properties. On the General tab, if you see a Security note saying the file came from another computer, tick Unblock and click OK. Reopen the file and the warning bar's Enable Content should now stick.
  5. Confirm the macro setting itself. Go to File > Options > Trust Center > Trust Center Settings > Macro Settings. The option Disable all macros with notification is the recommended everyday setting: macros are off by default but you get the warning bar to enable them per file. Disable all macros except digitally signed macros is stricter; Enable all macros turns off the protection entirely and should not be used.
  6. Add a Trusted Location for a folder you own. In Trust Center Settings, open Trusted Locations and click Add new location. Browse to a dedicated folder (for example a "Macro Workbooks" folder inside Documents), tick Subfolders of this location are also trusted if you want, and save. Any macro-enabled workbook saved there opens without a prompt. Do not add broad folders such as your whole Downloads folder or drive root.
  7. Confirm the file type is macro-enabled. Macros only survive in files saved as .xlsm or .xlsb. If the workbook is a plain .xlsx, the macro code is stripped when saved and nothing will run. Use File > Save As and choose Excel Macro-Enabled Workbook (*.xlsm).
  8. Check that macros are not silently disabled for the session. On the Developer tab, open Macro Security to reach the same settings, and use Macros to confirm your macro appears in the list. If the Developer tab is hidden, enable it under File > Options > Customize Ribbon.
  9. Unblock at the folder level if you trust the source. On Windows, right-click the folder the file sits in, open Properties and tick Unblock if it appears. This applies the same unblocking to files inside it that still carry the mark of the web.

On macOS, the equivalent path is Excel > Preferences > Security & Privacy (older versions label it Security) and the Macro Security button there. Files downloaded through Safari or Mail may be quarantined by Gatekeeper; open the file once and use the system prompt to confirm you want to open it. If macOS still refuses, check the file's quarantine attribute in Finder's Get Info panel rather than changing system-wide security settings.

Common Mistakes

  • Turning on "Enable all macros." This removes the warning bar for every file forever, including malicious ones. Use per-file enabling or a Trusted Location instead.
  • Trusting your entire Downloads folder. That folder is exactly where untrusted files land, so adding it as a Trusted Location defeats the protection.
  • Ignoring the file extension. Saving a macro workbook as .xlsx and wondering why the code vanished is one of the most common causes of "lost" macros.
  • Reopening from the email attachment each time. The mark of the web returns with every fresh download, so save once to a trusted folder and open from there.
  • Editing Trust Center settings on a managed PC. Work and school devices often have these options greyed out by group policy; changes there are not yours to make and may be reverted.
  • Assuming a macro error is a security block. If macros are enabled and still fail, the problem is often the code or a missing reference, not Excel's security.

Tips

  • Keep macro workbooks in one dedicated Trusted Location so the security model stays predictable.
  • Ask macro authors to sign their code with a digital certificate. Then Disable all macros except digitally signed macros becomes practical, and unsigned files stay blocked.
  • Test whether the macro actually runs by opening the Macros dialog and running it manually rather than relying on a workbook-open script.
  • Keep Excel updated. Security patches change how Protected View and the mark of the web behave, and old builds can behave inconsistently.
  • If you share a macro workbook, send the .xlsm file inside a ZIP and tell recipients to extract it to a trusted folder before opening.

Troubleshooting

Still no warning bar and nothing runs. The macro setting may be set to Disable all macros without notification. Change it to Disable all macros with notification and reopen the file. Check the Trust Center's Message Bar page as well; if the message bar is turned off, you will never see the prompt.

The file opens in Protected View and Enable Editing is missing. This usually means the file is in an untrusted location or has failed a validation check. Copy it to a local folder, unblock it, and reopen. If it still fails, the file may be damaged; ask the sender for a fresh copy.

The workbook is blocked entirely and Excel shows an error rather than a bar. Open File > Options > Trust Center > Trust Center Settings > Protected View and look at the three checkboxes. If files from the internet are set to open in Protected View, that is expected; enable editing after opening. If Excel refuses the file as potentially unsafe, do not force it open; verify the source first.

Macros run but fail partway. That is a code or reference problem rather than a security one. Open the editor with Alt+F11 (Windows) or the Developer tab on macOS, check for missing references, and ask the author to test on your Excel version.

Settings changes do not stick on a work PC. Your organisation manages Excel centrally. Ask IT to approve the file or the location; do not try to override policies yourself.

Frequently Asked Questions

Why does Excel keep blocking macros every time I open the same file?

Either the file still carries the mark of the web in a folder that is not a Trusted Location, or your macro setting is set to notify on every open. Unblock the file and place it in a Trusted Location to stop the repeated prompts.

Is it safe to click Enable Content?

Only if you know where the file came from and trust it. Enabling content runs whatever code the workbook contains, so never do it for unexpected attachments or files from strangers.

Why did my macros disappear after saving?

The file was probably saved as .xlsx. Use Save As and pick the macro-enabled .xlsm format; the code is preserved only there.

Can I enable macros for one file without changing any settings?

Yes. Open the file and click Enable Content on the security warning bar. It applies to that session only and does not weaken security elsewhere.

Does adding a Trusted Location lower my overall security?

It applies only to files in that folder. Keep the folder narrow and avoid adding Downloads, Desktop or a whole drive.

Why is the Enable Content button greyed out?

The file is likely in Protected View, still blocked, or the setting is managed by your organisation. Click Enable Editing first, then check the file's properties and your Trust Center policy.