numcrun
10-16-2010, 03:17 AM
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.
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
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