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 https://learn.microsoft.com/da-dk/microsoft-365-apps/security/internet-macros-blocked#vba-macro-notification-settingswhere the flowchart is taken from !
What do I have to do more under Windows 11 ?
11 Replies
- keldsorBrass Contributor
This thread has over time developed to a total mess, so I'm NOT able to mark any answer as a solution - sorry !
But ...
Somehow I managed to
- get rid of the yellow warning line on top of the screen
- SOMETIMES get the OnAction macro to run ... but most oftern it WONT !
But I can see out there the problem with missing macros has been a problem for years which means it MAYBY has nothing with Excel running under Windows 11 to do - but is a Excel error !
I'll create a Q on that issue and close this thread - thx for you time to all of you !
- keldsorBrass Contributor
In pure frustration I now CHANGED the registry key "TrustedRecords" 🤪
I RE-NAMED the ONLY trusted record key:
https://d.docs.live.net/b49b544c352c634a/FrandsensStamtræ/FrandsensStamtræ.xlsmto
C:\Users\kelds\OneDrive\SessesStamtræ\FrandsensStamtræ.xlsm
WITHOUT knowing whatever meaning the data VALUE have - maybe it' stupid, but I did it anyway ... 😁
I write "the ONLY trusted record key" because I could NOT get my OneDrive located xlsM-file to show up even though I tried several times to unblock by PowerShell !
Then I tried to start up my xlsm-file and it started like before but WITHOUT ANY warnings - YES - but unfortunately the OnAction-macro STILL wasn't present and therefore could NOT run - all other macros worked well !
When I looked in the registry again a NEW trusted record was added - so now it looks like this:
The "https://d.docs.live.net .... " (the one I RE-NAMED !) was back again !
Now I only have to find out:
- what the data VALUES mean for the two REG_BINARYs ?
- how can I get my OnAction-macro to be present and RUN when needed ?
Please give me some feed back or tell me if I'm working on very thin ice here ... or both !
- keldsorBrass Contributor
I got a little bit further with your proposals - THX, BUT ...
The "DisableMacroBlock.reg" would NOT run by double-clicking - I had to manually add the keys.
Too I did the PowerShell-fix !
Still I have a sort of blocking - but of another kind - I was link to https://support.microsoft.com/da-dk/topic/indstillinger-for-dokumenter-der-er-tillid-til-er-blevet-%C3%A6ndret-0be30e4c-926a-4761-bdef-3f91097beb5a:- keldsorBrass 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