Problem setting BackStyle on Label

L

Lynn. Rickards

I have a problem with Properties on Label in particular, when added by
a script.

The sequence below works on CommandButton1 and Frame1 objects but
behaves
strangely with Label1

Public Sub addLabel()
Sheet2.OLEObjects.Add "Forms.Label.1", _
Left:=100, Top:=75, Height:=15, Width:=200
End Sub

Public Sub nameLabel()
Sheet2.Label1.Name = "title1"

End Sub

Public Sub setLabel()

Sheet2.title1.BackStyle = 0
Sheet2.title1.Caption = "My Text"
Sheet2.title1.Font.Bold = 1
Sheet2.title1.Font.Italic = 1
Sheet2.title1.Font.Size = 12
End Sub

The one property that doesn't have any effect on the appearance is
BackStyle

However, the value *is* set when I look at the object properties.
Changing it manually
in the properties dialog also has no visual effect - the label keeps
it's white background.

Now, if I add a Label manually, I can set BackStyle to 0 and it
immediately becomes
transparent.

What am I missing? By the way, I have the same behavior on excel 2000
and 2003
and on several different machines.

TIA - Lynn.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top