Disable Macros through VBA

M

mirom

Is there any way to disable macros in the specific Workbook from VB
code, before opening that very same Workbook with VBA code i.e. to ope
some workbook in "Disable Macros MODE" using only VBA. Or, to refras
the question, how should be written in the VBA language, the event whe
user manualy opens some workbook and when prompted for macro viru
protection, he clicks the "Disable Macros" buton. For whic
"Object"(probably Workbook.VBProject) and what property (something lik
"Enable Macros") has changed at that occasion.
Thank You in advance. Regards. Mirom
 
D

Dave Peterson

I think that this was added in xl2002:

Application.AutomationSecurity

See VBA's help for details.

But if you're really asking how to disable events when you open a workbook (with
workbook_open code):

application.enableevents = false
workbooks.open filename:="..."
application.enableevents = true
 

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