Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have a userform (first tier) that calls another userform (second
tier), and the second tier userform has code associated with a combobox that opens a link to another excel file in a new window. After the the linked file is closed, I would like to return to the calling userform (second tier) and have both the first tier and second tier userforms again visible. I had it set up so that the hidden userforms were reshown by the WorkBookActivate event code; that seemed to work okay since the initial workbook became the active workbook when the temporarily viewed worksheet was closed. But, I ran into a problem with putting the code there, as that code runs too often for me. Sometimes, when that workbook becomes the active workbook I don't want the userforms to be displayed. The sequence of events is basically: display form1 display form 2 follow link to another excel file (but I don't see it if I don't hide the two forms) hide form2 hide form1 Exit sub close linked file return to initial workbook, but, forms are no longer visible; and I want them to be restored automatically Is there a way to reshow the forms after the linked file is closed? I have not been able to use the WorkbookActivate event and I prefer not to have to have any code in the linked files. I am hoping to have something in the code like "be right back", and having it pick up there, after the linked file is closed. Thanks Ken |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Try checking to see if the userforms are loaded before unhiding.
In the Workbook_Activate event: If Not Userform1 Is Nothing Then Userform1.Show If Not Userform2 Is Nothing Then Userform2.Show This precludes that when the userforms aren't needed then they get unloaded. This way, the code will unhide the userforms only when they're loaded. -- Garry Free usenet access at http://www.eternal-september.org ClassicVB Users Regroup! comp.lang.basic.visual.misc |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
cell link to userform | Excel Programming | |||
How to Link value from a Cell to a control in the userform | Excel Programming | |||
Link from Userform to Spreadsheet | Excel Programming | |||
Userform w/ Multiple listboxes that link | Excel Programming | |||
Userform w/ Multiple listboxes that link | Excel Programming |