A Microsoft Excel forum. ExcelBanter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » ExcelBanter forum » Excel Newsgroups » Excel Programming
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

closing another file by code causes failure to run workbook activate event



 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old July 9th 12, 05:47 PM posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 14
Default closing another file by code causes failure to run workbook activate event

I have a userform in workbook A that opens workbook B and hides the userform. File B has a button to "return to the userform (workbook A)". All the button does is close workbook B, which should activate workbook A and trigger the reshowing of the original userform; but the activation event doesn't trigger and the form does not reshow, but wb A is the active workbook. If I close workbook B with the x or file close command, workbook A is activated and the activation code runs, triggering the redisplay of the userform. All the code does is

ThisWorkbook.Close

It actually used to do a lof of other stuff, but, I can't get it to work with just this line. Something is different about closing the form from this one line macro, and closing through file close, I think. Can anyone shed any light on what is going on, and perhaps provide an alternate method?

I have also tried leaving wb B open, then close it when wb A is closed through the userform termination event. Wb A closes fine that way, but, if closing wb A is preceded by the closing of wb B in the userform termination code, the code stops after closing wb B and leaves wb A still open. Basically, when the userform is closed, I want both files to be gone; and I can't seem to get it done.

Thanks

Ken
 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Chart Activate event not triggered when workbook opened? [email protected] Excel Programming 0 September 2nd 06 02:37 AM
WorkBook Activate event not working [email protected] Excel Programming 14 June 12th 06 09:21 PM
Auto Activate (Window_Open Event) in Personal.xls when another workbook is loaded Nap Excel Programming 7 March 24th 06 09:22 AM
Pasting after Workbook Activate event Michael Malinsky[_2_] Excel Programming 2 June 6th 05 08:01 PM
Insert VBA code with a macro in a .xls file by workbook open event mihai[_3_] Excel Programming 8 July 29th 04 01:49 PM


All times are GMT +1. The time now is 04:19 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Copyright ©2004-2013 ExcelBanter.
The comments are property of their posters.