When your form is modal, the calling routine stops and waits until the
userform is closed and returns execution to it. When the form is modeless,
the procedure shows the form, then continues on its merry way.
What works best for a modeless form is to have one procedure that does
everything up to the showing of the form, then ends, and have another
procedure start when the user form is dismissed (i.e., called by the Close
button code).
- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
Peltier Technical Services, Inc. -
http://PeltierTech.com
_______
"Brandt" wrote in message
...
I sure hope someone can help me with this one. I have tried everything I
know of (which isn't all that much). I have an excel application that
basically creates a series of multi-pages on a userform based on a
directory
hierarchy that it is pointed to. On the multi-pages are buttons for each
file that exists in the folder that the specific multi-page represents.
What
I have created is just a simple way to access our company's in-house
software
that exists on our server. To do this I had to use what I believe is
called
"design mode" so that the application can create the buttons and add the
code
for the buttons to the code module. This all works fine, except that it
has
become apparent that this userform must be modeless so that it can be left
open. The code I use to call the form is:
VBA.UserForms.Add(TempForm.Name).Show vbModeless
If I leave off the 'vbModeless' portion everything works fine (except that
the form is modal). With the 'vbModeless' included, the userform is shown
for about 1/2 a second and closes and all remaining code executes.
Can anyone explain what is going on here? I can, of course, post
additional
code if necessary.
Thanks
Brandt