LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,441
Default Application.EnableEvents ... Is Local or Global ?

Matilda,

If you have a problem with this technique, I will send you a working example, with two sheets, one
of which can have the events disabled while the events on the other are unaffected. Contact me
privately if you require the example workbook.

HTH,
Bernie
MS Excel MVP


"Matilda" wrote in message
...
Bernie,

Those letters after your name of which I am deeply respectful mean that I am
going to stiffen my spine and give it a go YOUR way! I'll let you know how I
get on !

Thanks in advance

Matilda

"Bernie Deitrick" wrote:

Matilda,

I wouldn't toggle the value: I would specifically set it to True or False. And it shouldn't
affect
all open workbooks, just the workbook that has the conditional statement added as the first line
of
each event procedure.

HTH,
Bernie
MS Excel MVP


"Matilda" wrote in message
...

Thanks, Bernie. After setting the boolean test globally as you suggest,
can I set the events to off in the procedure code, then on again at finish of
execution? I tried this but all the open workbooks seemed to retain the
OFF setting, which is more than a little OFF putting!
If so, I must have toggled once too often, a likelihood I can check.

Many thanks,

Matilda
"Bernie Deitrick" wrote:

Matilda,

Declare a global public boolean, say, boolAllowEvents

and then at the top of each event, use

If Not boolAllowEvents Then Exit Sub

and set it to False when you don't want your events in that one book to run.

HTH,
Bernie
MS Excel MVP


"Matilda" wrote in message
...
Oh Boy - did I find THIS out the hard way :-((((
Is there any way to bypass worksheet settings at procedure level? I would
like to keep the settings in place, but execution at runtime every time a
sheet is accessed is slowing down my code to glacial speed.

Advice appreciated as always,

Matilda

"Chip Pearson" wrote:

EnableEvents is an application-wide setting -- it affects all
event procedures in all open workbook. There is no built-in way
to enable/disable events for a particular workbook.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com

"monir" wrote in message
...
Hello;

Book1.xls and Book2.xls, each has few events.
For editing purposes, if I open Book1 (which has
Application.EnableEvents =
True in its ThisWorkbook Open event module), and then open
Book2 (which has
Application.EnableEvents = False in its ThisWorkbook Open
event), ALL events
in both Book1 and Book2 become disabled !!!

Is this how it supposed to work ???

Thank you.











 
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
Application.EnableEvents DCPan Excel Worksheet Functions 3 October 18th 08 05:46 AM
application.EnableEvents nc Excel Discussion (Misc queries) 1 September 28th 05 04:00 PM
Application.EnableEvents = False not working Paul Martin Excel Programming 3 May 10th 05 05:06 AM
application.enableEvents jeffP Excel Programming 1 August 1st 04 03:12 PM
Application.EnableEvents Terry Excel Programming 2 April 2nd 04 08:25 PM


All times are GMT +1. The time now is 08:20 PM.

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

About Us

"It's about Microsoft Excel"