Search notes:

Programmatic access to Visual Basic Project is not trusted

Apparently, in order to use the object model of the Visual Basic Editor, access needs to be granted.
Otherwise, a run-time error 1004 (Programmatic access to Visual Basic Project is not trusted) is thronw.

Granting access

There seem to be two possibilities to grant access to the VBA object model: via the registry and via the trust center.

Trust Center

Granting access in the Trust Center:

Via registry

Access can be granted by setting the value AccessVBOM to 1 under the respective key under an Office's Security key, for example HKCU\Software\Microsoft\Office\x.y\Excel\Security

PowerShell Module MS-Office

My PowerShell module MS-Office has the function grant-msOfficeVBAAccess which sets the AccessVBOM value in the registry.

Misc

The German translation of Programmatic access to Visual Basic Project is «Der programatische Zugriff auf das Visual Basic-Projekt ist nicht sicher».

Index

Fatal error: Uncaught PDOException: SQLSTATE[HY000]: General error: 8 attempt to write a readonly database in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php:78 Stack trace: #0 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(78): PDOStatement->execute(Array) #1 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(30): insert_webrequest_('/notes/developm...', 1758210296, '216.73.216.150', 'Mozilla/5.0 App...', NULL) #2 /home/httpd/vhosts/renenyffenegger.ch/httpsdocs/notes/development/languages/VBA/Programmatic-access-to-Visual-Basic-Project-is-not-trusted(62): insert_webrequest() #3 {main} thrown in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php on line 78