Modernize Studio
Language: English
Get a free proposal

Microsoft Excel

Excel macros blocked: why, and how to unblock them

The workbook worked, now Excel shows a red bar and the macros will not run? It is a Microsoft protection that can be handled safely.

By Modernize StudioUpdated 6 min read

In short

  • Since 2022, Office for Windows blocks VBA macros in files that come from the internet: downloads, email attachments and some network folders.
  • The block depends on a label Windows adds to the copy of the file (the Mark of the Web), not on what the macro does.
  • For a single trusted file, ticking the unblock box in the file's properties is enough.
  • Files used every day need a trusted location or a network setting, agreed with whoever manages the computers.
  • Never enable all macros: that is exactly the gap viruses use.

What happens, and why

For years, opening a file with macros showed a yellow warning with an Enable Content button: one click was enough. It was also the most common way to spread viruses through email attachments, so Microsoft changed the rules.

Since 2022, Office for Windows blocks VBA macros in files that come from the internet. This applies to Excel, Word, PowerPoint, Access and Visio, and later to Publisher and Project as well. Instead of the yellow warning there is a red bar, and the button to enable macros is gone.

The bar shown in the English version of Office, redrawn. In other languages the text is translated, but the colour and the missing button to enable macros are the same.

Office for Mac, the phone and tablet apps and Office on the web are not affected by this change.

The label that decides everything

When you download a file in the browser or save an email attachment, Windows adds a hidden label to the copy saying where it came from: the Mark of the Web. Excel reads it when the file opens and, if the file came from the internet, keeps the macros switched off, even if they are harmless and even if a colleague sent it.

The path of a macro-enabled file that comes from the internet.

That is why the same file works on the computer of the person who created it and is blocked on the computer of the person who received it: the received copy has the label, the original does not.

Before unblocking: can the file be trusted?

The block exists for a good reason. Before removing it, answer three questions:

  • Do you know who created the file, and were you expecting it?
  • Does it come from an address you know, rather than an unexpected message urging you to hurry?
  • Do you actually need the macros, or is the file asking you to enable them just to show you its content?

An invoice, a delivery note or a document “to unblock” that arrives without warning is the classic virus trick, even when the sender looks like someone you know. If in doubt, check with the sender by another means, not by replying to the same email.

1. Unblock a single file

For a trusted file used now and then, the route Microsoft gives is to remove the label from the copy:

  1. Close the file

    If it is open in Excel, close it.

  2. Open its properties

    In File Explorer, right-click the file and choose Properties.

  3. Tick the unblock box

    At the bottom of the General tab there is a security note with an Unblock box. Tick it and confirm with OK.

  4. Open the file again

    The macros now behave as they would in a file you created yourself.

The General tab of the file's properties in Windows, redrawn: the box to tick is “Unblock”.

Unblock only the copy you need: if the same file arrives again by email, the new copy will carry the label again.

If the box is missing and the file is in a network folder, the answer is in step 3. If the macros still do not run after unblocking, Microsoft notes that unblocking only works when no company policy and no Trust Center setting blocks macros: in that case the decision lies with whoever manages the computers.

2. A trusted folder for everyday files

For a macro-enabled file opened every day, such as a price list or a report, unblocking every new copy is a chore. Excel lets you set trusted locations: folders whose files open with macros enabled, without checking the label.

You set them under File › Options › Trust Center › Trust Center Settings › Trusted Locations, with the button to add a new location.

Microsoft advises using them sparingly and recommends against making network folders trusted. A trusted location accepts any file: keep only files whose origin you know there.

3. Files in a network folder, on OneDrive or on SharePoint

Even a file in the office's shared folder can be blocked if Windows does not treat that folder as part of the internal network. Microsoft notes that this happens, for example, when the folder is reached through an IP address such as \\192.168.1.20\data.

The fix it gives is to add the address to the Windows Trusted sites, or to the Local intranet zone. It is best left to whoever manages the network: the setting also applies to other programs, and it can be rolled out to every computer at once.

For files on OneDrive and SharePoint, it depends on how you open them. Opened with the desktop app command, or from the folder synced to the computer, they get no label. Downloaded through the browser, they do.

What not to do

  • Do not enable all macros in the Trust Center: you would remove the protection from every file, dangerous ones included.
  • Do not make the Downloads folder trusted, or the desktop: everything ends up there, including things you did not choose.
  • Do not turn off the antivirus to open a file: if the file is safe, the steps above are enough.

Would you like an opinion on your case?

Send us the file: within 48 hours you receive a free written assessment, even if the answer is that a small fix is enough.

How our prices work

When the problem comes back every week

If the macro-enabled file passes from hand to hand, by email or on a USB stick, every new copy gets the label again. You can sign the VBA code digitally and install the certificate as a trusted publisher on the computers, but that needs a certificate and central management.

Often it is a sign that the file has become a business application in its own right. Turning it into a web application solves the problem at the root: no files to send, no macros, and everyone works on the same data. Here is how we bring macro-enabled Excel workbooks to the web.

Frequently asked questions

Why does the same macro work on one computer and not on another?

Because the block depends on the copy of the file, not on the macro. The copy that was downloaded or received by email carries the label saying it came from the internet; the one created on the computer does not.

Does the block apply to .xlsx files too?

No: .xlsx files cannot contain VBA macros. It applies to macro-enabled formats such as .xlsm, .xlsb and .xls, and to Excel templates and add-ins.

Can the block be switched off for the whole company?

With Microsoft 365 Apps for enterprise, administrators have policies to manage it, but Microsoft recommends keeping it on and using trusted locations, trusted sites or digitally signed macros.

Is unblocking a file dangerous?

Only if the file cannot be trusted. By unblocking it you tell Excel that you trust it: its macros can then do anything your user account can do on the computer.

Are macros blocked the same way on a Mac?

No: the change Microsoft describes applies to Office for Windows. Office for Mac has its own macro security settings.

Sources

  1. Microsoft: macros from the internet are blocked by default in Office
  2. Microsoft: a potentially dangerous macro has been blocked
  3. Microsoft: add, remove or change a trusted location

Official Microsoft pages.

Related guides

Related services

All guides

Contact

We work in writing: everything stays on record, so you can show it to your accountant or your IT person.

Send us your file

  1. Make a copy of the file; test data is fine.
  2. Attach it to your message. If you would like a non-disclosure agreement first, write to us without attaching the file.
  3. Within 48 hours you will receive the free written assessment and the price of a pilot module.

We work from Italy.

Describe your project in a few lines

A small request is fine too. If anything is missing, we will ask you.

Fields marked * are required.

For example: what the workbook is used for · how many people use it · Excel version, if known · does it read from or write to other files?

Attachment(optional)

Databases, Excel files, screenshots or a specification. For larger files, include a download link in your message. We only work on copies and delete them at the end of the project, with written confirmation.

Reply within one working day. Free proposal, no obligation.

Get a free proposal