Enabling Turst access to Visual Basic Projects

S

Sam J

Hi Is it some how possible to Enable Turst access to Visual Basic Projects
from a VBA Code.
 
A

AndyM

It is possible to Enable Trust to Visual Basic Project from VBA code.

It can be modifed through regedit.exe. It is called AccessVBOM, which can
also be modified through VBA code. However, closing Excel will set the
AccessVBOM value back to the level that is indicated in the "Trust access to
Visual Basic Project" checkbox.

One option is to change the AccessVBOM value within a vbScript so Excel
doesn't need to be open. If you need this done within VBA, the only option I
can think of is the following:
-VBA code closes workbook
-On workbook close, vbScript is called
-vbScript waits until all Excel apps are closed, changes AccessVBOM value,
then re-opens your Excel workbook

The code to change the AccessVBOM value is available on several forums, just
try searching for it.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top