Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Turn off ThisWorkbook Code?

Is there any way that I can prevent ThisWorkbook code from working
while I am running some public sub?

I have a Workbook_SheetChange procedure in ThisWorkbook, but I don't
want it to run while my other procedure is changing cells.

Thank you

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Turn off ThisWorkbook Code?

Well, I can create a public variable = True while the module sub is
being run and check if it's True within Workbook_SheetChange sub. It
works ok, but I am just curious if there is anything that would
actually turn off ThisWorkbook code?

Thanks

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default Turn off ThisWorkbook Code?

You can turn off events (like the _SheetChange etc), but this depends on
whether you other code requires events.

Appilcation.EnableEvents = False
'Code...
'Turn back on when finished
Appilcation.EnableEvents = True

Otherwise set a Public boolean and test that at the beginning of each
routine that should/should not run.

NickHK

wrote in message
ups.com...
Is there any way that I can prevent ThisWorkbook code from working
while I am running some public sub?

I have a Workbook_SheetChange procedure in ThisWorkbook, but I don't
want it to run while my other procedure is changing cells.

Thank you



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Turn off ThisWorkbook Code?

Thank you, NickHK! That is exactly what I was asking for.

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
Inserting Code within ThisWorkbook via Code Q Sean Excel Programming 1 January 22nd 07 05:00 PM
Populate ThisWorkbook via Code Sean Excel Programming 13 January 14th 07 06:03 PM
Deleting Code in 'ThisWorkbook' Ken Loomis Excel Programming 4 March 25th 05 01:36 PM
Code to automatically turn on and turn off Track Changes John[_46_] Excel Programming 1 October 7th 03 02:22 AM
Delete the code in ThisWorkbook Darrin Henry Excel Programming 1 October 1st 03 11:10 PM


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