D
don bowyer
I have 2 workbooks Wb1 & Wb2 open
I have code which does something under the WindowActivate
event in the ThisWorkbook Object for each Wb.
If I am displaying Wb1 and use Window on the main workbook
menu to switch to
Wb2, then the WindowActivate event is triggered for Wb2,
as expected, and my code
runs.
If I then use File, Close on main workbook menu to close
Wb2, the WindowActivate
event is triggered for Wb1 and my code runs.
Now the rub. I have code options which close the active
Wb:-
Workbooks("Filename.xls").Close savechanges:=False
Workbooks("Filename.xls").Close savechanges:=True
If I use either of these to close Wb1 both do as required,
BUT do not trigger the WindowActivate for Wb2.
Maybe that's how Excel VBA works, but I do need a trigger
for Wb(x)
when I use my code to close Wb(y)
Am looking for something that don't exist?
Any help would be much appreciated.
Don Bowyer
I have code which does something under the WindowActivate
event in the ThisWorkbook Object for each Wb.
If I am displaying Wb1 and use Window on the main workbook
menu to switch to
Wb2, then the WindowActivate event is triggered for Wb2,
as expected, and my code
runs.
If I then use File, Close on main workbook menu to close
Wb2, the WindowActivate
event is triggered for Wb1 and my code runs.
Now the rub. I have code options which close the active
Wb:-
Workbooks("Filename.xls").Close savechanges:=False
Workbooks("Filename.xls").Close savechanges:=True
If I use either of these to close Wb1 both do as required,
BUT do not trigger the WindowActivate for Wb2.
Maybe that's how Excel VBA works, but I do need a trigger
for Wb(x)
when I use my code to close Wb(y)
Am looking for something that don't exist?
Any help would be much appreciated.
Don Bowyer