Forum Discussion
Default blocking of macros ???
According to this flowchart:
Macros will be enabled IF the document is located in a trusted location !
But it's NOT the case !
I have set my Onedrive as a trusted location and I still have my macros blocked !
My OneDrive have a COPY of a shared folder from other person and this setup WORKS nicely under Windows 10 but NOT under Windows 11 !
It's as though the new default CAN'T be overwritten !
I cant figure out what I have to do from the article where the flowchart is taken from !
What do I have to do more under Windows 11 ?
7 Replies
- keldsorCopper Contributor
EDIT: SOME macros ARE running - this one:
Private Sub Workbook_Open() ' ActiveWindow.DisplayGridlines = False ' Application.DisplayFormulaBar = False ' ActiveWindow.DisplayHeadings = False ' Application.CommandBars.ExecuteMso "HideRibbon" ' Application.ExecuteExcel4Macro "show.toolbar(""Ribbon"",FALSE)" With ThisWorkbook nextPNR = .Sheets("NR-Ark").Range("A1") ' dette 2 linier opfattes MÅSKE som en andring af filen ???? rejectOpenWord = .Sheets("NR-Ark").Range("A5") markerObjecter True MsgBox Environ("IDFrandsen"), , "Der køres på disse data:" End With End Sub
and after I click OK button a YELLOW line telling me settings for trusted documents are changed and THEN I have the key that leads me to the site I linked to i my last posting.
You can allow Office to trust documents again. Here’s a registry script that reenables Trusted Documents behavior:
Windows Registry Editor Version 5.00 [HKEY_CURRENT_USER\Software\Microsoft\Office\16.0\Excel\Security\Trusted Documents] "DisableTrustedDocuments"=dword:00000000 "AllowTrustedLocationsInNetworkLocations"=dword:00000001
Again, adjust the version number (16.0) if needed.
Then, after opening the file and enabling content once, it should remember the trust and stop showing the yellow banner unless the file changes or the cache resets again.
IF NOT
Instead of trusting each file, make sure the entire folder is trusted.
You can:
- Go to Excel > File > Options > Trust Center > Trust Center Settings > Trusted Locations.
- Add the full local path to your OneDrive folder.
- Check “Subfolders of this location are also trusted.”
⚠️ But keep in mind: shared folders from others in OneDrive don’t always inherit this trust — this only applies to your local synced files.
------------------------------------
Don't forget to mark as solution if my answer suits you
What’s happening is that Microsoft tightened macro security recently. Even if you’ve added your OneDrive folder as a trusted location, files with a "Mark of the Web" (MOTW) are still blocked — especially if they come from shared folders or the internet. And if it’s a shared OneDrive folder (someone else’s folder synced to your OneDrive), Office doesn’t treat it as trusted, even if it looks local.
This used to work fine on Windows 10, but starting with Office Version 2203 on Windows 11, you have to explicitly disable the setting that blocks macros from internet files — otherwise Office will just block them by default, even in a trusted folder.
Here's what you can do:
- Make sure your local OneDrive path is added as a Trusted Location in the Trust Center under File > Options > Trust Center > Trust Center Settings > Trusted Locations. Also, make sure the "Subfolders of this location are also trusted" box is checked.
- Then, to disable the macro-blocking policy, you can import the registry settings below. Just paste this into a text file, save it as DisableMacroBlock.reg, and double-click it to add it to your registry:
Windows Registry Editor Version 5.00 [HKEY_CURRENT_USER\Software\Microsoft\Office\16.0\Word\Security] "BlockContentExecutionFromInternet"=dword:00000000 [HKEY_CURRENT_USER\Software\Microsoft\Office\16.0\Excel\Security] "BlockContentExecutionFromInternet"=dword:00000000 [HKEY_CURRENT_USER\Software\Microsoft\Office\16.0\PowerPoint\Security] "BlockContentExecutionFromInternet"=dword:00000000
(Replace 16.0 with 15.0 for Office 2013, or 14.0 for Office 2010, etc.)
3. If you're opening a downloaded or shared file, you can also manually remove the MOTW by:
- Right-clicking the file > Properties > Check “Unblock”, if available.
- Or running this in PowerShell:
Unblock-File -Path "C:\Your\Path\To\File.xlsm"
So yeah — it’s not just you. Windows 11 + the new Office macro security policy is what’s causing this. 😅
Give this a try and let me know if it solves the issue for you!------------------------------------
Don't forget to mark as solution if my answer suits you