Disable Macros through VBA

  • Thread starter Thread starter mirom
  • Start date Start date
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
 
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
 
Back
Top