Forum Discussion
Default blocking of macros ???
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:
- keldsorAug 01, 2025Brass 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.
- Aug 01, 2025
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- keldsorAug 02, 2025Brass Contributor
I've now investigated a little more !
I still have this stupid YELLOW line on top og the sheet - but it can be closed with the X-button and then the sheet SEEMS to work BUT...
in fact it's the macro referenced in my OnAction for each shape that CAN'T be found ... ALL other macros WILL run.
My Excel sheet has a lot of SHAPES users can click and then the OnAction SHOULD start a macro with some parameters from that shape - but the macro can't be found !
What's so special with these "OnAction" for each of my shapes ?