Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Is there anyway to get excel to re-enable application events after i
close a workbook. Right now I have in some code: Application.EnableEvents = False ThisWorkbook.Close Application.EnableEvents = True However, the enableevents never gets set back to true as the sub stops running when excel closes. Any help is appreciated. |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
John,
I'm assuming that you don't want to run the Workbook_BeforeClose event: include code like this at the top of the Workbook_BeforeClose event: If boolDontRun Then Exit Sub Declare a global variable in a standard codemodule: Public boolDontRun As Boolean Then instead of Application.EnableEvents = False ThisWorkbook.Close Application.EnableEvents = True Use boolDontRun = True ThisWorkbook.Close HTH, Bernie MS Excel MVP "John Fuller" wrote in message ups.com... Is there anyway to get excel to re-enable application events after i close a workbook. Right now I have in some code: Application.EnableEvents = False ThisWorkbook.Close Application.EnableEvents = True However, the enableevents never gets set back to true as the sub stops running when excel closes. Any help is appreciated. |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
That's what I have done, was just hoping there was a way of avoiding
the global variable (just a rule I have, the always seem to cause problems). Thanks though. Bernie Deitrick wrote: John, I'm assuming that you don't want to run the Workbook_BeforeClose event: include code like this at the top of the Workbook_BeforeClose event: If boolDontRun Then Exit Sub Declare a global variable in a standard codemodule: Public boolDontRun As Boolean Then instead of Application.EnableEvents = False ThisWorkbook.Close Application.EnableEvents = True Use boolDontRun = True ThisWorkbook.Close HTH, Bernie MS Excel MVP "John Fuller" wrote in message ups.com... Is there anyway to get excel to re-enable application events after i close a workbook. Right now I have in some code: Application.EnableEvents = False ThisWorkbook.Close Application.EnableEvents = True However, the enableevents never gets set back to true as the sub stops running when excel closes. Any help is appreciated. |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I think this may help u
write this code in the workbook_windowdeactivate event Application.EnableEvents = True regards murali John Fuller wrote: Is there anyway to get excel to re-enable application events after i close a workbook. Right now I have in some code: Application.EnableEvents = False ThisWorkbook.Close Application.EnableEvents = True However, the enableevents never gets set back to true as the sub stops running when excel closes. Any help is appreciated. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Application.EnableEvents | Excel Worksheet Functions | |||
Call Application.Volatile(True) NOT WORKING | Excel Discussion (Misc queries) | |||
Application.EnableEvents = true, but no event fires | Excel Programming | |||
Application.EnableEvents | Excel Programming |