Skip to content

What to Do When Microsoft Blocks Macros in a File

See a red Security Risk banner saying Microsoft blocked macros from running? Learn why this warning appears and how to safely handle or unblock your file.

Phones and ComputersNovember 11, 20263 min read

When you open a file in Excel, Word, or PowerPoint, you might see a red banner across the top. It says: “SECURITY RISK: Microsoft has blocked macros from running because the source of this file is untrusted.” Unlike the older yellow warning bar, this red banner has no button to turn the macros back on.

If you did not expect this file, close it and delete it. Do not unblock a file unless you know who sent it and why it needs macros.

Why it matters

An Excel macro is a small program built inside a document or spreadsheet. People use macros to automate repetitive tasks, like adding up a monthly budget or formatting a long table.

Because macros are small programs, criminals sometimes hide harmful code inside them. When you download a file from a website or save it from an email, Windows attaches a hidden tag to that file to show it came from the internet. When Microsoft Office sees that tag, it stops any macros inside the file from running and shows the red banner instead1.

File name: Shipping_Notice_8812.xlsm - Excel

SECURITY RISKMicrosoft has blocked macros from running because the source of this file is untrusted.

Learn More

This document is protected

To view it, follow the steps in the email to unblock this file, then open it again.

Red flags in this file

This built-in rule is a helpful part of keeping your phones and computers safe. Most everyday files—like receipts, tax forms, or shipping notices—do not need macros at all. If a stranger sends you an unexpected invoice attachment and the email includes instructions on how to unblock the file, it is a trap.

What to do

Use this guide to decide what to do with the file on your screen.

Should you unblock this file?

Did you expect to receive or download this specific file?

If you do not trust the file

  1. Close the file in Excel, Word, or PowerPoint.

  2. Delete the file from your computer’s Downloads folder or wherever you saved it.

  3. Delete the email it came in.

So long as Microsoft blocked the macros and you did not unblock the file, the macro code did not run.

If you are certain the file is safe

Sometimes a file you trust—such as a club budget from a friend or an older spreadsheet you downloaded from your own cloud storage—needs macros to work properly. You can remove the block for that single file in Windows.

  1. Save any changes and close the file in Excel, Word, or PowerPoint.

  2. Open File Explorer (the folder icon on your taskbar) and find the file.

  3. Right-click the file and select Properties from the menu.

  4. At the bottom of the General tab, look for the Security section.

  5. Check the box next to Unblock.

  6. Click OK.

  7. Open the file again. If a yellow bar appears asking you to Enable Content, click it to let the macros run.

Common questions

Why is a workbook that worked on my old computer blocked now?

Microsoft added the red banner rule in recent versions of Office, including Microsoft 365. If you move an old macro file to a new computer by emailing it to yourself or downloading it from the internet, Windows marks it as coming from outside your computer and blocks the macros.

What if the Unblock box is missing or the red banner stays?

If the file is stored in a shared network folder or a work account, Windows may treat that whole folder as an untrusted internet location. If you see a message saying your administrator has restricted macros, a workplace rule is blocking them. You will need to ask the person who manages that computer or network for help.

For more information

  1. Marco VBA error with Microsoft 365 for excellearn.microsoft.com

Keep reading

More in Phones and Computers

What Is an Excel Macro?

An Excel macro is a small program inside a spreadsheet file. Learn why scammers hide harmful instructions in macros and why you should not click Enable Content.

DefinitionText and Email Scams