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

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest
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,213,486
Messages
6,113,932
Members
448,533
Latest member
thietbibeboiwasaco

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