View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Andym Andym is offline
external usenet poster
 
Posts: 35
Default Enabling Turst access to Visual Basic Projects

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.

"Sam J" wrote:

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