Modeless userform doesn't show if called twice from a modal userform (HELP!)

Oliver Dewar

Board Regular
Joined
Apr 17, 2011
Messages
201
Hi All,

I have a bizarre occurrence!

I recently posted a thread here because I had a modeless userform (modeless1) which was activated from a modal userform (modal1) and when used, returned back to modal1 in a loop - the user could then call modeless1 again if more data needs to be processed and around we go.

The original problem was that modeless1 would only show once then fail to load on the second loop. Well, we overcame that with the following from the command button on modal1:

Code:
Dim modelessForm As Object
Set modelessForm = New modeless1
'then call the form
modeless1.Show False

this calls modeless1 over and over again no problems... except that now I've found a random instance (in a different sequence of forms) where modeless1 will show once or twice (?!) then half load blank before totally disappearing!

Each time I close modeless1 using unload me so it's not hidden.

Anyone got any other ideas how to call a fresh version of modeless1 each time? Or any other ideas?

Thanks a ton in advance!
 

Excel Facts

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.
This is a guess.

Try changing this...
Code:
modeless1.Show False

To this...
Code:
[COLOR="Red"]modelessForm[/COLOR].Show False

If that alone doesn't work, additionaly try setting modelessForm to nothing when you close the form.
Code:
Set modelessForm = Nothing
 
Upvote 0
Hi Alphafrog,

Thanks for your ideas. Unfortunately they didn't work.

I've found a workaround though. I simply return to a sheet devoted to being in the middle of this loop, as if it were a userform in the loop, and from that sheet there's a command button that calls modal1 if needed. This way whatever's going wrong is being reset after each loop and modeless1 appears every time.

Cheers!;)
 
Upvote 0

Forum statistics

Threads
1,223,155
Messages
6,170,403
Members
452,325
Latest member
BlahQz

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top