Label Caption - Code

paulyf

New Member
Joined
Mar 27, 2002
Messages
34
Hi all,

I've been trying to have my form display a "Loading files...Please wait" message whilst it opens a file. However, the following code displays the label after it has opened the file (i.e. - too late!). How can I display the label before commencing the opening of the file?

Any thoughts?? Many Thanks in anticipation.

Cheers - Paul

Private Sub loadsup_Click()
lblwait.Visible = True
lblwait.Caption = "Loading files...Please wait"
ChDir "C:blah blah"
Workbooks.Open Filename:="C:blah blahtest.xls"
 

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.
Hi Paul
Use the UserForm.RePaint Method


<pre>


Private Sub loadsup_Click()
lblwait.Visible = True
lblwait.Caption = "Loading files...Please wait"
UserForm1.Repaint
Workbooks.Open Filename:="C:blah blahtest.xls"
End Sub

</pre>

Replace UserForm1 with the name of your form.
Tom
 
Upvote 0
Not sure how to edit initial post (answers on a postcard) but PROBLEM SOLVED.

MANY THANKS!

Cheers - Paul
 
Upvote 0

Forum statistics

Threads
1,214,522
Messages
6,120,020
Members
448,939
Latest member
Leon Leenders

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top