Window Trigger Event.

D

donwb

Excel 2003
I have 2 WBs open, say WB 1 & WB 2.
WB 2 is visible or active, whilst WB1 is "hidden."
If I close WB 2, is there anything, anywhere for macro purposes
that is triggered by the appearance of WB 1.
The command "Private Sub Workbook_SheetActivate(ByVal Sh As Object)"
appears not to be triggered, presumably because the sheet is already
effectively active.
However, a "change" has undoubtedly occured in the prevailing conditions,
as a different window gets displayed.
The problem is, I can't find an associated trigger!!
Any ideas.
DonWB
 
J

JLGWhiz

If WB1 is hidden and you do anything to WB2, including closing it, then WB1
is not the active workbook untile WB2 closes. Then it seems to me that WB1
would at least be the workbook with focus, although hidden. But the Sheet
activate procedure might not run because the Workbook is tecnically open.
The one event that occurs for sure is the Close event for WB2. Could you use
that for your trigger?
 
D

donwb

Hi JLGWhiz
Yes, I agree with your analysis.
I had hoped that the change of focus from WB 2 to WB 1
was a "recorded", event - a trigger - which could have been used but I
guess it's not available to VBA?
donwb
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top