ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Application EnableEvents (https://www.excelbanter.com/excel-programming/435213-application-enableevents.html)

B Lynn B

Application EnableEvents
 
If I set EnableEvents to False while my code is running, and then
accidentally exit the code without setting back to True - does this property
get reset to True when Excel is closed? My testing seems to verify that it
does, but I'm at a point where I could use confirmation. Thanks!

Gord Dibben

Application EnableEvents
 
It resets to TRUE when Excel is closed.


Gord Dibben MS Excel MVP

On Tue, 20 Oct 2009 14:11:01 -0700, B Lynn B
wrote:

If I set EnableEvents to False while my code is running, and then
accidentally exit the code without setting back to True - does this property
get reset to True when Excel is closed? My testing seems to verify that it
does, but I'm at a point where I could use confirmation. Thanks!



JockW

Application EnableEvents
 
Hi
Your code will be reset when the workbook is opened again.

You could add:

Sub reset()
Application.EnableEvents = True
End Sub


to tour worksheet code.
If your code is stopped for whatever reason, press <Alt + <F8 and select
this sub to re-enable your code.
Saves shutting down and starting again.
hth.
Jock



"B Lynn B" wrote:

If I set EnableEvents to False while my code is running, and then
accidentally exit the code without setting back to True - does this property
get reset to True when Excel is closed? My testing seems to verify that it
does, but I'm at a point where I could use confirmation. Thanks!



All times are GMT +1. The time now is 07:31 PM.

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