Must something be done to a userform?

S

Shatin

I have a workbook with many XML maps. Whenever I want to refresh the XML
data, it would take some time. So I've done a userform to show a simple
"Please wait" message. There's no button or anything else on the userform.
My macro is as below. When the macro is run, once the userform
("ProgressForm") is shown, it just stays there and the macro doesn't proceed
to the next line. Must I do something to a userform once it's shown? How can
I tell the macro to move to the next line?

Sub RefreshXML()

Dim xm As XmlMap

ProgressForm.Show 'There's no button on this form, only a simple "Please
wait" label.

For Each xm In ThisWorkbook.XmlMaps
xm.DataBinding.Refresh
Next xm

ProgressForm.Hide

End Sub

TIA
 
T

Tom Hutchins

Go into the properties of your userform and set ShowModal to False. You might
also want to add a 1-second delay before starting the other processing, to
make sure the userform gets drawn completely. To add a 1-second delay, use

Application.Wait Now + TimeValue("0:00:01")

Hope this helps,

Hutch
 
S

Shatin

That solves the problem! Many thanks!


Tom Hutchins said:
Go into the properties of your userform and set ShowModal to False. You
might
also want to add a 1-second delay before starting the other processing, to
make sure the userform gets drawn completely. To add a 1-second delay, use

Application.Wait Now + TimeValue("0:00:01")

Hope this helps,

Hutch
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top