PDA

View Full Version : Window Activate Anomoly



pcsparky
12-08-2009, 11:36 AM
Title should read: Workbook Activate Anomoly

I have WB1 that uses modeless Userform1 to open WB2 & hides itself.

WB2 has a modal Userform2. I have been trying to get Workbook_Activate event in WB1 to execute when WB2 closes so that I can reload Userform1.

If I use the X at the top right of the WB to close it, the Workbook_Activate in WB1 does activate. However, if I use Thisworkbook.Close in WB2 code it fails to run the Workbook_Activate event in WB1.

I have also tried closing WB2 from WB1 but cannot get Userform1 to reload as the focus goes to WB2.

Any suggestions most welcome.

lucas
12-08-2009, 12:45 PM
Clue for you. 9 people before me looked at this and didn't respond.

If you provide the workbook so we don't have to reproduce it and guess at the code you are using maybe you will have better luck.

pcsparky
12-09-2009, 06:06 AM
I think it's just one of those Excel moments. I've decided to remove the form from the other workbook and place it in WB1, that way focus stays with it.