Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 215
Default Application.EnableEvents ... Is Local or Global ?

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.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Application.EnableEvents ... Is Local or Global ?

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.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 770
Default Application.EnableEvents ... Is Local or Global ?

monir,

Properties of the Application object, such as EnableEventsand
ScreenUpdating, apply to all of Excel, i.e., they are global.

hth,

Doug

"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.



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 215
Default Application.EnableEvents ... Is Local or Global ?

Chip & Doug;
Thank you very much for the clarification.


"Doug Glancy" wrote:

monir,

Properties of the Application object, such as EnableEventsand
ScreenUpdating, apply to all of Excel, i.e., they are global.

hth,

Doug

"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.




  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 215
Default Application.EnableEvents ... Is Local or Global ?

Now ... If I open Book2 first (which has Application.EnableEvents = False),
then open Book1 (which has Application.EnableEvents = True), then why ALL
events in both Book1 & Book2 become also disabled ?

And, if I move the above Aapplication object from ThisWorkBook open event to
a Worksheet event, would this make any differenece on how it's treated?

Thanks again.


"monir" wrote:

Chip & Doug;
Thank you very much for the clarification.


"Doug Glancy" wrote:

monir,

Properties of the Application object, such as EnableEventsand
ScreenUpdating, apply to all of Excel, i.e., they are global.

hth,

Doug

"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.






  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Application.EnableEvents ... Is Local or Global ?

If you disable events in Book2, and then open Book1, events won't
fire in Book1 because Book2 disabled events, so your
Workbook_Open event procedure won't run.


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


"monir" wrote in message
...
Now ... If I open Book2 first (which has
Application.EnableEvents = False),
then open Book1 (which has Application.EnableEvents = True),
then why ALL
events in both Book1 & Book2 become also disabled ?

And, if I move the above Aapplication object from ThisWorkBook
open event to
a Worksheet event, would this make any differenece on how it's
treated?

Thanks again.


"monir" wrote:

Chip & Doug;
Thank you very much for the clarification.


"Doug Glancy" wrote:

monir,

Properties of the Application object, such as
EnableEventsand
ScreenUpdating, apply to all of Excel, i.e., they are
global.

hth,

Doug

"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.





  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 57
Default Application.EnableEvents ... Is Local or Global ?

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.




  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,441
Default Application.EnableEvents ... Is Local or Global ?

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.






  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 57
Default Application.EnableEvents ... Is Local or Global ?


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.






  #10   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,441
Default Application.EnableEvents ... Is Local or Global ?

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.










  #11   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 57
Default Application.EnableEvents ... Is Local or Global ?

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.









  #12   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.











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
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:59 AM.

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"