D
donwb
Hi Bob
Hi Bob
Workbook specific custom toolbars
Not sure if you were able to pick up my response to your last message.
Here it is:-
By way of a simple test, I created two WBs, Test1 & Test2.
Test1 has the code:-
Sub MyClose()
ThisWorkbook.Close SaveChanges:=False
End Sub
located in "ThisWorkbook"
Test2 has the code:-
Private Sub Workbook_Activate()
MsgBox "I'm activated"
End Sub
also located in "ThisWorkbook"
With both WBs open, if I run the code in Test1 to close it
an error message appears:-
"Application-defined or object-defined error",
WB1 closes, but the MsgBox never appears.
However, if I close WB1 using instead the menu bar user interface
File/Close,
Activate is triggered and the MsgBox appears.
I want to do the closing programmatically so I'm still stuck.
donwb
Hi Bob
Workbook specific custom toolbars
Not sure if you were able to pick up my response to your last message.
Here it is:-
By way of a simple test, I created two WBs, Test1 & Test2.
Test1 has the code:-
Sub MyClose()
ThisWorkbook.Close SaveChanges:=False
End Sub
located in "ThisWorkbook"
Test2 has the code:-
Private Sub Workbook_Activate()
MsgBox "I'm activated"
End Sub
also located in "ThisWorkbook"
With both WBs open, if I run the code in Test1 to close it
an error message appears:-
"Application-defined or object-defined error",
WB1 closes, but the MsgBox never appears.
However, if I close WB1 using instead the menu bar user interface
File/Close,
Activate is triggered and the MsgBox appears.
I want to do the closing programmatically so I'm still stuck.
donwb