ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Must something be done to a userform? (https://www.excelbanter.com/excel-programming/408660-must-something-done-userform.html)

Shatin[_2_]

Must something be done to a userform?
 
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


Tom Hutchins

Must something be done to a userform?
 
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

"Shatin" wrote:

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



Shatin[_2_]

Must something be done to a userform?
 
That solves the problem! Many thanks!


"Tom Hutchins" wrote in message
...
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

"Shatin" wrote:

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





All times are GMT +1. The time now is 04:57 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com