ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Deactivating all events in ThisWorkbook (https://www.excelbanter.com/excel-programming/332710-deactivating-all-events-thisworkbook.html)

Gwen[_3_]

Deactivating all events in ThisWorkbook
 
Hi,

Is there a code that can deactivating all events contained in the
ThisWorkbook hiddensheet?

Thanks.



JMB

Deactivating all events in ThisWorkbook
 
Try this:

Application.EnableEvents = False

"Gwen" wrote:

Hi,

Is there a code that can deactivating all events contained in the
ThisWorkbook hiddensheet?

Thanks.




GB

Deactivating all events in ThisWorkbook
 
True that this will disable events for the hidden sheet, but it will also
disable events for every sheet. So, if you don't want events to occur on the
hidden sheet, then prior to causing something that would start an event on
the hidden sheet, turn off events, then turn them back on once you are "done"
working on the hidden sheet, however, if the hidden sheet links to other
sheets, then you may run into other problems.

Then again, if there are particular events that you want to be able to
perform on the hidden sheet for given changes, then you can capture which
cell(s) have changed, and disable the particular event. (I think... I'm
wrapping myself around an axle thinking about this one.)
Good luck. :)

"JMB" wrote:

Try this:

Application.EnableEvents = False

"Gwen" wrote:

Hi,

Is there a code that can deactivating all events contained in the
ThisWorkbook hiddensheet?

Thanks.




DM Unseen

Deactivating all events in ThisWorkbook
 
There are just 3 solutions:

temporarerly disable all events. and turn them on when youre done.
Create a global varaible which is inspected by all concerned events
that you can set to TRUE to let all those events know they should exit
ASAP instead of running
Create a Class module to sink the events of the worksheet in, then you
can disconnect the events by destroying the class variable, and
reconnect by creating it again this is the most pretty, but you need to
know how to handle class modules.

DM Unseen



All times are GMT +1. The time now is 06:43 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com