-
Solved: transparent command button vba
When I create a command button manually and set it as transparent it is. But the code below does not make it transparent, even though the properties say it is.
[vba]
Private Sub Worksheet_Activate()
Set obj = ActiveSheet.OLEObjects.Add(ClassType:="Forms.CommandButton.1", _
Link:=False, DisplayAsIcon:=False, Left:=307, Top:=80, Width:=40, Height:=40)
obj.Name = "CommandButton1"
ActiveSheet.OLEObjects("CommandButton1").Object.BackStyle = fmBackStyleTransparent
ActiveSheet.OLEObjects("CommandButton1").Object.Caption = ""
End Sub
[/vba]
-
try:
[vba]With ActiveSheet.OLEObjects.Add(ClassType:="Forms.CommandButton.1", _
Link:=False, DisplayAsIcon:=False, Left:=307, Top:=80, Width:=40, Height:=40)
.Name = "CommandButton1"
.Object.BackStyle = fmBackStyleTransparent
.Object.Caption = ""
.ShapeRange.Fill.Transparency = 1#
End With
[/vba]
p45cal
Everyone: If I've helped and you can't be bothered to acknowledge it, I can't be bothered to look at further posts from you.
-
Thanks very much, that's the one!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules