Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 44
Default disable and enable macro execution using VBA in another workbook?

Workbook A.xls has a Worksheet_Change() subroutine that is unintentionally
executed when cell content is modified by VBA code in Workbook B.xls.

Using VBA code executing in Workbook B.xls, I would like to:
1) disable macro exection for workbook A.xls while its content is being
manipulated by VBA code in Workbook B.xls;
2) re-enable macro exection for workbook A.xls prior to saving it.

Any suggestions?

Thanks,

Keith


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default disable and enable macro execution using VBA in another workbook?

Hi Keith,

Try wrapping the problematic instruction with EnableEvents statements,
e'g.:

Application.enableEvents = False 'Disable events

'code line(s)


Application.EnableEvents = True 're-enable events


---
Regards,
Norman



"keithb" wrote in message
...
Workbook A.xls has a Worksheet_Change() subroutine that is unintentionally
executed when cell content is modified by VBA code in Workbook B.xls.

Using VBA code executing in Workbook B.xls, I would like to:
1) disable macro exection for workbook A.xls while its content is being
manipulated by VBA code in Workbook B.xls;
2) re-enable macro exection for workbook A.xls prior to saving it.

Any suggestions?

Thanks,

Keith



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
Enable/Disable Macro Pop-Up juamig Excel Discussion (Misc queries) 5 April 12th 10 02:57 PM
enable/disable macro RICK Excel Discussion (Misc queries) 4 June 15th 06 07:55 PM
Disable VBA code execution when loading a workbook Charles Excel Discussion (Misc queries) 4 October 14th 05 09:12 PM
Enable/Disable Macro Brandon[_5_] Excel Programming 0 June 1st 04 06:36 PM
macro disable and enable. paul[_12_] Excel Programming 1 January 9th 04 01:29 PM


All times are GMT +1. The time now is 02:00 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"