Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 118
Default UserForm label doesn't load?

I made a small UserForm with a label that says "Waiting" to pop up during
some of my longer macro routines. I'm trying it in one program using the
code below, but the Label never loads - it stays a white square. What would
be the best way to figure out why it won't load? Or does anyone have a
correction for this?

Ed

<Dims here

Load UserForm1
cntFound = 0

MyTarget = ""
MyTarget = Application.InputBox("What text are you searching for?")
If MyTarget = "" Or MyTarget = "False" Then GoTo Bye

UserForm1.Show vbModeless

Range("B1").Activate
strName = ActiveWorkbook.Name
Application.ScreenUpdating = False

Do
<loop through code
<Form unloaded at end


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default UserForm label doesn't load?

UserForm1.Show vbModeless
DoEvents

--
Regards,
Tom Ogilvy

"Ed" wrote in message
...
I made a small UserForm with a label that says "Waiting" to pop up during
some of my longer macro routines. I'm trying it in one program using the
code below, but the Label never loads - it stays a white square. What

would
be the best way to figure out why it won't load? Or does anyone have a
correction for this?

Ed

<Dims here

Load UserForm1
cntFound = 0

MyTarget = ""
MyTarget = Application.InputBox("What text are you searching for?")
If MyTarget = "" Or MyTarget = "False" Then GoTo Bye

UserForm1.Show vbModeless

Range("B1").Activate
strName = ActiveWorkbook.Name
Application.ScreenUpdating = False

Do
<loop through code
<Form unloaded at end




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 923
Default UserForm label doesn't load?

Presumably the userform loads since you see a white square which also means
that the form control also loads. So how is the Label caption being set?
Have you placed this in the form control properties? An obvious one but
what colors have you specified for the label caption?

Try specifying the caption as part of the form initialize event. So behind
the form try

Private Sub UserForm_Initialize()
Label1.Caption = "Please Wait"
End Sub

Cheers
Nigel

"Ed" wrote in message
...
I made a small UserForm with a label that says "Waiting" to pop up during
some of my longer macro routines. I'm trying it in one program using the
code below, but the Label never loads - it stays a white square. What

would
be the best way to figure out why it won't load? Or does anyone have a
correction for this?

Ed

<Dims here

Load UserForm1
cntFound = 0

MyTarget = ""
MyTarget = Application.InputBox("What text are you searching for?")
If MyTarget = "" Or MyTarget = "False" Then GoTo Bye

UserForm1.Show vbModeless

Range("B1").Activate
strName = ActiveWorkbook.Name
Application.ScreenUpdating = False

Do
<loop through code
<Form unloaded at end




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 118
Default UserForm label doesn't load?

Nigel: I added this to my form, but it didn't help.

Private Sub UserForm_Initialize()

With Label1
.Height = 30
.Width = 132
.Caption = "Waiting"
.BackColor = RGB(255, 0, 0)
.Font.Name = "Matura MT Script Capitals"
.Font.Size = 22
.Font.Italic = True
.BorderStyle = fmBorderStyleSingle
End With

End Sub

"Nigel" wrote in message
...
Presumably the userform loads since you see a white square which also

means
that the form control also loads. So how is the Label caption being set?
Have you placed this in the form control properties? An obvious one but
what colors have you specified for the label caption?

Try specifying the caption as part of the form initialize event. So

behind
the form try

Private Sub UserForm_Initialize()
Label1.Caption = "Please Wait"
End Sub

Cheers
Nigel

"Ed" wrote in message
...
I made a small UserForm with a label that says "Waiting" to pop up

during
some of my longer macro routines. I'm trying it in one program using

the
code below, but the Label never loads - it stays a white square. What

would
be the best way to figure out why it won't load? Or does anyone have a
correction for this?

Ed

<Dims here

Load UserForm1
cntFound = 0

MyTarget = ""
MyTarget = Application.InputBox("What text are you searching for?")
If MyTarget = "" Or MyTarget = "False" Then GoTo Bye

UserForm1.Show vbModeless

Range("B1").Activate
strName = ActiveWorkbook.Name
Application.ScreenUpdating = False

Do
<loop through code
<Form unloaded at end






  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 118
Default UserForm label doesn't load?

Tom - I was going to say it didn't work, then I realized I stuck it in after
the Load and not after the Show. Changed it to the right place and it
worked. I'll never doubt you again! 8)

Thanks again.
Ed

"Tom Ogilvy" wrote in message
...
UserForm1.Show vbModeless
DoEvents

--
Regards,
Tom Ogilvy

"Ed" wrote in message
...
I made a small UserForm with a label that says "Waiting" to pop up

during
some of my longer macro routines. I'm trying it in one program using

the
code below, but the Label never loads - it stays a white square. What

would
be the best way to figure out why it won't load? Or does anyone have a
correction for this?

Ed

<Dims here

Load UserForm1
cntFound = 0

MyTarget = ""
MyTarget = Application.InputBox("What text are you searching for?")
If MyTarget = "" Or MyTarget = "False" Then GoTo Bye

UserForm1.Show vbModeless

Range("B1").Activate
strName = ActiveWorkbook.Name
Application.ScreenUpdating = False

Do
<loop through code
<Form unloaded at end






Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to load a listbox in a userform? Martin Excel Discussion (Misc queries) 3 July 25th 07 03:16 PM
Load caption box on userform open ExcelMonkey Excel Worksheet Functions 1 April 3rd 07 11:02 PM
UserForm Wont Load Minitman[_4_] Excel Programming 6 April 29th 04 07:49 AM
new error when try to load userform izchk shtifman Excel Programming 1 December 30th 03 06:09 PM
Load a Userform Nick Excel Programming 1 September 10th 03 03:24 PM


All times are GMT +1. The time now is 09:42 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"