<Pass the Torch> from a Closing Workbook

  • Thread starter Thread starter Alex J
  • Start date Start date
A

Alex J

All,
I am working with two workbooks, wbA and wbB.

wbA opens wbB. wbB does some work interactively with the user, then the user
closes wbB with a button on a modeless userform uaing the statement
"ThisWorkbook.Close".

I wish wbA to detect that wbB is now closed and to continue its work.(e.g.:
Show a userform in the context of the file which was just exited).

The Problem:
If the user closes wbB manually, wbA WorkbookActivate event is fired. (This
is good)
If the ThisWorkbook.Close command is initiated in wbB itself, no
WorkbookActivate event is
triggered when wbB closes . It becomes impossible to detect, from wbA, that
wbB is closed
(This is bad).

Any suggestions?

Thanks for your help,
Alex J
 
Alex J said:
wbA opens wbB. wbB does some work interactively with the user, then the user
closes wbB with a button on a modeless userform uaing the statement
"ThisWorkbook.Close".

I wish wbA to detect that wbB is now closed and to continue its work.(e.g.:
Show a userform in the context of the file which was just exited).
....

If wbB should only open when wbA opens it, and control should return to wbA
when it's closed, why not have the button in the userform in wbB call a
macro in wbA that closes wbB and proceeds on to whatever else you want wbA
to do?
 
Harlan,
Can I infer that you provided a SUBLIMinal response to my question <BG>?

I had already attempted your suggestion, and ended up with some problems,
hence the desire to use an event. I'll try this again.

Regards,
Alex
 
Back
Top