Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi all,
The workbook Deactivate event is called when the active workbook is changed and when the workbook is closed. The event BeforeClosed for a workbook is called before the event Deactivate. Is there a way to determine if the WB deactivation is caused by a Close operation or a change operation? Thanks faffo1980 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Copy the below code in 'This Workbook' and try...
Dim blnClose As Boolean Private Sub Workbook_BeforeClose(Cancel As Boolean) blnClose = True End Sub Private Sub Workbook_Deactivate() If blnClose Then MsgBox "Close_Deactivate" Else MsgBox "Deactivate" End If End Sub If this post helps click Yes --------------- Jacob Skaria "faffo1980" wrote: Hi all, The workbook Deactivate event is called when the active workbook is changed and when the workbook is closed. The event BeforeClosed for a workbook is called before the event Deactivate. Is there a way to determine if the WB deactivation is caused by a Close operation or a change operation? Thanks faffo1980 |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
in the code page for ThisWorkbook
Option Explicit Private closeflag As Boolean Private Sub Workbook_BeforeClose(Cancel As Boolean) closeflag = True End Sub Private Sub Workbook_Deactivate() If closeflag Then MsgBox "Closed" Else MsgBox "changed" End If End Sub "faffo1980" wrote: Hi all, The workbook Deactivate event is called when the active workbook is changed and when the workbook is closed. The event BeforeClosed for a workbook is called before the event Deactivate. Is there a way to determine if the WB deactivation is caused by a Close operation or a change operation? Thanks faffo1980 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Changing sheets after the DeActivate Event. | Excel Discussion (Misc queries) | |||
Workbook Deactivate event problem | Excel Programming | |||
Activate / Deactivate mouse move event | Excel Programming | |||
Workbook Deactivate Event | Excel Programming | |||
Canīt Convert Formulas to Values with Deactivate event | Excel Programming |