Excel 2003 VBA
I have 2 workbooks open.
If I close one, should "Worksheet_Activate" trigger on the other?
Excel 2003 VBA
I have 2 workbooks open.
If I close one, should "Worksheet_Activate" trigger on the other?
No, only if that window has focus. eg: if you had a browser open and your workbook is behind it.
Just try a test;
![]()
Private Sub Workbook_Activate() MsgBox "activated" End Sub
Last edited by yeon; 12-10-2018 at 10:52 AM. Reason: typo
I don't think so. Only if you actually activate the other one. I don't think it becomes active by default. Does it trigger if you click on something in the remaining workbook?
I am five versions past Excel 2003 so I can't test it.
Jeff
| | |·| |·| |·| |·| | |:| | |·| |·|
Read the rules
Use code tags to [code]enclose your code![/code]
Your title says Workbook_Activate but your post says Worksheet_Activate - which one do you mean? The former should be triggered, the latter not.
Everyone who confuses correlation and causation ends up dead.
My mistake
I meant Worksheet_Activate.
But I have found the problem - I found an instruction "Application.EnableEvents = False" lurking in the code.
Deleted it - now it triggers.
Sorry for the trouble.
A Worksheet_Activate event should only be triggered by switching sheets in the same workbook. Switching between workbooks by any method should not trigger it.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks