WorkBook Deactivate Event
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
|