ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Excel Form/Label Won't Show (https://www.excelbanter.com/excel-programming/412041-excel-form-label-wont-show.html)

LarryP

Excel Form/Label Won't Show
 
Ran into an odd thing just now. I set up a simple form in Excel that is
shown when a VBA procedure is running, then hidden when it ends (just tells
the user something is going on so he doesn't get bored or frustrated and
start pushing buttons). The form opens and closes like it's supposed to, but
the label containing the text of my message is blank, just a white square.
I've looked through all the properties and can't see anything that would
explain it. Anybody have an idea?

Sam Wilson

Excel Form/Label Won't Show
 

Can you post the code in question? It might help shed some light

"LarryP" wrote:

Ran into an odd thing just now. I set up a simple form in Excel that is
shown when a VBA procedure is running, then hidden when it ends (just tells
the user something is going on so he doesn't get bored or frustrated and
start pushing buttons). The form opens and closes like it's supposed to, but
the label containing the text of my message is blank, just a white square.
I've looked through all the properties and can't see anything that would
explain it. Anybody have an idea?


LarryP

Excel Form/Label Won't Show
 
The code is simply ...

PricingMessage.Show
'Do some stuff
'PricingMessage.Hide

'PricingMessage' is of course the name of the form, and the 'do some stuff'
is a called procedure that runs for about a minute +/- . As I said, the
form opens just fine, and closes just fine, the only problem is that the
label looks like it doesn't have any text in it. The form still serves the
purpose because its caption also tells the user to stand by, but my label, if
it would show, tells them a little more about what's going on. I can see it
just fine in design view, but not when the form actually opens.




"Sam Wilson" wrote:


Can you post the code in question? It might help shed some light

"LarryP" wrote:

Ran into an odd thing just now. I set up a simple form in Excel that is
shown when a VBA procedure is running, then hidden when it ends (just tells
the user something is going on so he doesn't get bored or frustrated and
start pushing buttons). The form opens and closes like it's supposed to, but
the label containing the text of my message is blank, just a white square.
I've looked through all the properties and can't see anything that would
explain it. Anybody have an idea?


Peter T

Excel Form/Label Won't Show
 
With your model form I'm surprised you are able to run 'Do some stuff' until
after dismissing the form, perhaps you are showing vbModeless or there's
more to it. Anyway, you may need to do either
PricingMessage.Repaint
or drop in a DoEvents.
The latter would allow user to press any buttons with possible unwanted
consequences. OTH if fully catered for and handled that might also give the
user a potential way to abort.

Regards,
Peter T

I'm surprised
"LarryP" wrote in message
...
The code is simply ...

PricingMessage.Show
'Do some stuff
'PricingMessage.Hide

'PricingMessage' is of course the name of the form, and the 'do some

stuff'
is a called procedure that runs for about a minute +/- . As I said, the
form opens just fine, and closes just fine, the only problem is that the
label looks like it doesn't have any text in it. The form still serves

the
purpose because its caption also tells the user to stand by, but my label,

if
it would show, tells them a little more about what's going on. I can see

it
just fine in design view, but not when the form actually opens.




"Sam Wilson" wrote:


Can you post the code in question? It might help shed some light

"LarryP" wrote:

Ran into an odd thing just now. I set up a simple form in Excel that

is
shown when a VBA procedure is running, then hidden when it ends (just

tells
the user something is going on so he doesn't get bored or frustrated

and
start pushing buttons). The form opens and closes like it's supposed

to, but
the label containing the text of my message is blank, just a white

square.
I've looked through all the properties and can't see anything that

would
explain it. Anybody have an idea?




Sam Wilson

Excel Form/Label Won't Show
 
You need to make sure the form is opened as modeless.
eg pricingmethod.show vbmodless


"LarryP" wrote:

The code is simply ...

PricingMessage.Show
'Do some stuff
'PricingMessage.Hide

'PricingMessage' is of course the name of the form, and the 'do some stuff'
is a called procedure that runs for about a minute +/- . As I said, the
form opens just fine, and closes just fine, the only problem is that the
label looks like it doesn't have any text in it. The form still serves the
purpose because its caption also tells the user to stand by, but my label, if
it would show, tells them a little more about what's going on. I can see it
just fine in design view, but not when the form actually opens.




"Sam Wilson" wrote:


Can you post the code in question? It might help shed some light

"LarryP" wrote:

Ran into an odd thing just now. I set up a simple form in Excel that is
shown when a VBA procedure is running, then hidden when it ends (just tells
the user something is going on so he doesn't get bored or frustrated and
start pushing buttons). The form opens and closes like it's supposed to, but
the label containing the text of my message is blank, just a white square.
I've looked through all the properties and can't see anything that would
explain it. Anybody have an idea?


Gary Keramidas

Excel Form/Label Won't Show
 
try this:

UserForm1.Label1.Caption = "Summarizing Data"
DoEvents

--


Gary


"LarryP" wrote in message
...
Ran into an odd thing just now. I set up a simple form in Excel that is
shown when a VBA procedure is running, then hidden when it ends (just tells
the user something is going on so he doesn't get bored or frustrated and
start pushing buttons). The form opens and closes like it's supposed to, but
the label containing the text of my message is blank, just a white square.
I've looked through all the properties and can't see anything that would
explain it. Anybody have an idea?




LarryP

Excel Form/Label Won't Show
 
I had set my form to modeless, but I added a .Repaint after the .Open and a
DoEvents after both the .Repaint and the 'Do some stuff. Fixed the problem;
thanks to all.

"Peter T" wrote:

With your model form I'm surprised you are able to run 'Do some stuff' until
after dismissing the form, perhaps you are showing vbModeless or there's
more to it. Anyway, you may need to do either
PricingMessage.Repaint
or drop in a DoEvents.
The latter would allow user to press any buttons with possible unwanted
consequences. OTH if fully catered for and handled that might also give the
user a potential way to abort.

Regards,
Peter T

I'm surprised
"LarryP" wrote in message
...
The code is simply ...

PricingMessage.Show
'Do some stuff
'PricingMessage.Hide

'PricingMessage' is of course the name of the form, and the 'do some

stuff'
is a called procedure that runs for about a minute +/- . As I said, the
form opens just fine, and closes just fine, the only problem is that the
label looks like it doesn't have any text in it. The form still serves

the
purpose because its caption also tells the user to stand by, but my label,

if
it would show, tells them a little more about what's going on. I can see

it
just fine in design view, but not when the form actually opens.




"Sam Wilson" wrote:


Can you post the code in question? It might help shed some light

"LarryP" wrote:

Ran into an odd thing just now. I set up a simple form in Excel that

is
shown when a VBA procedure is running, then hidden when it ends (just

tells
the user something is going on so he doesn't get bored or frustrated

and
start pushing buttons). The form opens and closes like it's supposed

to, but
the label containing the text of my message is blank, just a white

square.
I've looked through all the properties and can't see anything that

would
explain it. Anybody have an idea?






All times are GMT +1. The time now is 03:47 AM.

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