View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Dave Peterson[_5_] Dave Peterson[_5_] is offline
external usenet poster
 
Posts: 1,758
Default Dynamic Label Caption

I couldn't reproduce your description either.

But if you minimize the worksheet (or even the application), then resize, do you
still see the problem.

When I've added controlbuttons (also from the control toolbox toolbar), I
sometimes can't see them until I do this--I think it's a screen refreshing thing
(technical term!).

Maybe adding a DoEvents to your code would help (maybe not).

And I think I'd try the label from the Forms toolbar to see if that behaved
better.

=====
But I don't have a guess about what you describe in your follow up.

MacDermott wrote:

Thanks a lot for the tip, Gary!

Unfortunately, that doesn't seem to have been the problem.
I've been playing around a bit, and have found the same thing with both
labels and textboxes.
If I change a label's caption, or a textbox's text or value in code, the
spreadsheet shows the old value until I click on the control. Then it shows
the new value.
I continue to see the new value as long as the focus stays on a control.
As soon as I set it back to a spreadsheet cell, the old value returns.
It's as if there's another property that has to be set.

Any ideas?
TIA!
- Turtle

"Gary Brown" wrote in message
...
Sounds like you have something (possibly just a space " ") in the sell to

the
right of the label. If so, delete it and the full caption should show.
HTH,
Gary Brown


"Turtle MacDermott" wrote:

I have a spreadsheet which I am filling from Access using VBA.
I put a label on it, using the Controls Toolbox.
The label's caption reads "Created:"

In VBA, I set
ActiveSheet.OLEObjects("MyLabel").object.caption=" Created: " & Now()

When I step through the code, I see the caption being set correctly.

Now, when I look at the spreadsheet, I see the original caption,

"Created:"
without the date.
But if I click on the label, it shows the entire value.
Click off it to something else, and it returns to the original value.

How can I make it display the new value even when the label is not

selected?

TIA
- Turtle




--

Dave Peterson