Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

show userform during macro execution

Status
Not open for further replies.

wmbb

Technical User
Jul 17, 2005
320
NL
I want to show a userform during macro execution telling the users that a process is running and they have to wait until the macro is finished.
To do so, I've created a userform displaying the message "Please wait, processing files !"
In the macro I start showing the form using frmMessage.show but the macro doesn't continue until the userform is closed.
Is there a way to show the userform while the macro is running and close the userform at the end of the macro ?

Thanks in advance
 
What about this ?
frmMessage.Show vbModeless

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Thank you for your quick response.
Using your code the macro continues as it should but the userform is not showing the message (textlabel) in the form.
On the internet I found a code that works for me but I don't understand it:

With frmMessage
.Show False
.Repaint
End With

Can someone explain how this piece of works when the .show option is set to false ?
 
You can find ShowModal as one of userform properties. ".Show False" tells vba do show the form modeless.
The modal form breaks the calling procedure and the control is passed back to it when the form is closed (or, more precisely, hidden).
Modeless form is executed paralelly to the calling code.

It's hard to say why the message is not displayed without knowing how you set it.

Alternatively you can consider to use status bar to display messages (as excel does).

combo
 
Thank you for your explaination.
The most important thing is that it is working thanks to you...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top