View Single Post
  #10   Report Post  
Posted to microsoft.public.excel.programming
Peter T Peter T is offline
external usenet poster
 
Posts: 5,600
Default Bring my modeless userform to the foreground???

I haven't followed all this thread but if the form is already loaded as
modeless you must include the modeless argument again to re-show it (because
the default is modal).

If the objective is to bring it to the front there are API ways but
following can simply solve some other difficulties.

With UserForm1
..Hide
..Show vbModeless
End With

This assumes you already know the form is loaded and visible

Regards,
Peter T

"Robert Crandal" wrote in message
...
So, would my code roughly look like this:

If Not MySpecialFormLoaded("UserForm1") Then
UserForm1.Show vbModeless
Else
UserForm1.Show ' Just show it if it's already loaded
End If

Is that what you mean??


"Rick Rothstein" wrote in message
...
UserForm1.Show, by itself, does not create new instances of your
UserForm... you must be running the code you showed us each time you
click the button too... don't do that... put an If..Then test to see if
the UserForm is visible... if it is, just execute the UserForm1.Show
command, otherwise run the code you posted previously to load/show it.

--
Rick (MVP - Excel)