Search notes:

PowerShell module MS-Office: grant-msOfficeVBAAccess

The function grant-msOfficeVBAAccess of the PowerShell module MS-Office grants access to the VBA object model by setting AccessVBOM to 1 under an Office's registry key (for example HKEY_CURRENT_USER\Software\Microsoft\Office\X.Y\Excel\Security)
Without granted access, VBA code throws Programmatic access to Visual Basic Project is not trusted.

Index