You open an Excel, Word or PowerPoint file received by email or downloaded, and a red security risk banner says: "Microsoft has blocked macros from running because the source of this file is untrusted". This is not a fault: since 2022, Office on Windows blocks VBA macros in files from the Internet by default, because they are often used to install malware. The Enable Content button therefore no longer appears for these files.
First of all: should this file really contain macros?
Microsoft makes the point: reading or editing a document does not require macros. If you were not expecting this file, or if a stranger or a message pushes you to "enable content" (order cancellation, invoice, legal document), do not unblock anything and delete the file. The steps below only apply to files whose origin and purpose you know.
Observe before acting
The block relies on the Mark of the Web: Windows adds zone information to the downloaded file. To read it, open Command Prompt in the file's folder and type (replace the name):
notepad classeur.xlsm:Zone.Identifier
Notepad shows a ZoneId line under [ZoneTransfer]. According to Microsoft: 0 = My Computer, 1 = Local intranet, 2 = Trusted sites, 3 = Internet, 4 = Restricted sites. With ZoneId=3, macros are blocked by default; with 2, they are not. If Notepad finds nothing, the file does not carry this mark.
| What you see | Most likely cause | Step |
|---|---|---|
| ZoneId=3, file downloaded or received by email | Mark of the Web | Step 1 |
| File on a network share or internal site, no Unblock checkbox | Location classified in the Internet zone | Step 2 |
| Many trusted files in the same local folder | Folder not trusted | Step 3 |
| File on OneDrive or SharePoint | File downloaded instead of opened in the app | Step 4 |
| "Your administrator has restricted the use of macros" | Company policy | Step 5 |
Step 1: unblock a single file
When to use it: a trusted file downloaded or received as an attachment.
Expected result: the red banner disappears; depending on your Office settings, a yellow bar may still ask you to enable content.
Rollback: there is no checkbox to put the mark back; delete the unblocked copy and download the original file again if you change your mind.
Step 2: files on a network share or internal site
When to use it: the Unblock checkbox is missing, or ticking it changes nothing, for files opened on a file server or an internal site.
Microsoft explains that if the share is considered to be in the Internet zone (for example when it is opened by its IP address, like \\192.168.1.10\partage), the Unblock checkbox has no effect.
Expected result: macros in files from this location are no longer blocked by the Mark of the Web.
Rollback: same window, select the address and Remove.
Warning: Microsoft cautions that you will then trust all macros from this location, and that the site also gets elevated permissions outside Office. Only do this if you control who can save files there.
Step 3: trust a local folder
When to use it: you regularly work with trusted macro-enabled files stored in the same folder on your PC.
Expected result: files opened from this folder run their macros without the banner.
Rollback: same screen, select the location and Remove.
Do not trust a catch-all folder such as Downloads or the Desktop.
Step 4: files on OneDrive or SharePoint
When to use it: the file is stored on OneDrive, SharePoint or in the files of a Teams channel.
Expected result: the file opened directly from OneDrive or SharePoint no longer shows the Mark of the Web banner.
Rollback: none.
Step 5: block enforced by your company
When to use it: the message mentions your administrator, or the options above are greyed out.
Expected result: the file works from the location approved by your company.
Rollback: none.
What not to do
- Choose Enable all macros in the macro settings: this removes the protection for every file.
- Add the whole C: drive or the Downloads folder as a trusted location.
- Unblock a file just because its content asks you to.
Final check
- ☐ The origin of the file is known and expected.
- ☐ notepad fichier:Zone.Identifier no longer finds ZoneId=3 (unblocked local file).
- ☐ The red banner is gone when the file is reopened.
- ☐ Added trusted locations are limited to folders or servers you control.
Sources
- Microsoft Support: A potentially dangerous macro has been blocked
- Microsoft Learn: Macros from the internet are blocked by default in Office
- Microsoft Learn: Unblock-File
For PowerShell scripts blocked for the same reason, see "Running scripts is disabled on this system" in PowerShell.
Still having the problem?
Reply to this topic with the app and its version (File > Account > About), where the file comes from (email, website, network share, OneDrive), the ZoneId value shown and the exact text of the banner. Do not attach the file, and remove server or user names.