Hi,
When I use the following code to create a Label in an ActiveSheet, and the background of the sheet has the same color as the Label's, say grey, then the Label will have something like a half-frame, i.e., the 2 side of the ractagangle will turn clear or white.
If I do not use the following code, manually create the Label instead, what mentioned above will not happen. I have over 20 reports to take care of and each one has about 10 Labels to be produced. Mannully doing the labels will not be my first choice.
My question is if I can use VBA to create labels without the annoying frame?
Thanks in advance.
Sub CrtLabels()
Dim lb1 As Object
Set lb1 = ActiveSheet.OLEObjects.Add(ClassType:="Forms.Label.1", Link:=False, _
DisplayAsIcon:=False, Left:=6.75, Top:=26.25, Width:=28.5, Height:=14.25)
With lb1.Object
.Caption = "Whatever"
.BackColor = "&H80000003"
.Font.Name = "MS Sans Serif"
.Font.Size = 8.5
End With
End Sub
When I use the following code to create a Label in an ActiveSheet, and the background of the sheet has the same color as the Label's, say grey, then the Label will have something like a half-frame, i.e., the 2 side of the ractagangle will turn clear or white.
If I do not use the following code, manually create the Label instead, what mentioned above will not happen. I have over 20 reports to take care of and each one has about 10 Labels to be produced. Mannully doing the labels will not be my first choice.
My question is if I can use VBA to create labels without the annoying frame?
Thanks in advance.
Sub CrtLabels()
Dim lb1 As Object
Set lb1 = ActiveSheet.OLEObjects.Add(ClassType:="Forms.Label.1", Link:=False, _
DisplayAsIcon:=False, Left:=6.75, Top:=26.25, Width:=28.5, Height:=14.25)
With lb1.Object
.Caption = "Whatever"
.BackColor = "&H80000003"
.Font.Name = "MS Sans Serif"
.Font.Size = 8.5
End With
End Sub