Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Disabling macros when opening a workbook?
I am using a macro that opens other workbooks to collect information from those workbooks, but some of these have an open_workbook sub in the thisworkbook object. I don't want the open_workbook sub to run when I open these workbooks and have my macro retain cotrol over things. When I try using "Application.AutomationSecurity = msoAutomationSecurityForceDisable" before opening the workbook, the workbook will open but then things stop completely with visual basic still running but waiting in the module containing the macros I just disabled when opening the workbook. How can I avoid this? Thanks for any help. -- John |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Disabling macros when opening a workbook?
Give Application.EnableEvents = False a try. DO NOT Forget to set this
back to true. Restart Excel does not change this setting. Application.EnableEvents = True Charles Chickering John wrote: I am using a macro that opens other workbooks to collect information from those workbooks, but some of these have an open_workbook sub in the thisworkbook object. I don't want the open_workbook sub to run when I open these workbooks and have my macro retain cotrol over things. When I try using "Application.AutomationSecurity = msoAutomationSecurityForceDisable" before opening the workbook, the workbook will open but then things stop completely with visual basic still running but waiting in the module containing the macros I just disabled when opening the workbook. How can I avoid this? Thanks for any help. -- John |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Disabling macros when opening a workbook?
Thank you very much. This works very well.
-- John "Die_Another_Day" wrote: Give Application.EnableEvents = False a try. DO NOT Forget to set this back to true. Restart Excel does not change this setting. Application.EnableEvents = True Charles Chickering John wrote: I am using a macro that opens other workbooks to collect information from those workbooks, but some of these have an open_workbook sub in the thisworkbook object. I don't want the open_workbook sub to run when I open these workbooks and have my macro retain cotrol over things. When I try using "Application.AutomationSecurity = msoAutomationSecurityForceDisable" before opening the workbook, the workbook will open but then things stop completely with visual basic still running but waiting in the module containing the macros I just disabled when opening the workbook. How can I avoid this? Thanks for any help. -- John |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Enabling/Disabling Macros w/o closing & re-opening | Excel Programming | |||
How do I turn off macros when programmatically opening a workbook. | Excel Programming | |||
Disable Macros when opening workbook | Excel Programming | |||
Open workbook-macros enabled, opening another with macros | Excel Programming | |||
Opening a workbook containing macros from VB | Excel Programming |