Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,069
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 644
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,069
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Enabling/Disabling Macros w/o closing & re-opening Conan Kelly Excel Programming 1 August 31st 06 12:38 AM
How do I turn off macros when programmatically opening a workbook. PhilBerkhof Excel Programming 3 December 10th 04 09:55 PM
Disable Macros when opening workbook Rob[_21_] Excel Programming 7 November 12th 04 09:22 AM
Open workbook-macros enabled, opening another with macros George J Excel Programming 5 September 17th 04 02:07 PM
Opening a workbook containing macros from VB Brian Walters Excel Programming 2 August 6th 03 10:20 PM


All times are GMT +1. The time now is 07:55 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"