ich möchte gern meine eigene Commandbarbuttons anlegen, das geht auch soweit.
nur möchte ich diesen auch gern Bilder zuweisen. Um genau zu sein ich möchte System-Icons oder Excel-Symbole zuweisen. Wie kann ich das machen?
Danke für die Hilfe. Sylvio
Private Sub Workbook_Open()
On Error Resume Next
Dim Symbolleistenname As String
Dim CB As CommandBar
Dim CMB As CommandBarButton
Symbolleistenname = "Syntec"
Set CB = Application.CommandBars(Symbolleistenname)
'Symbolleiste ist nicht vorhanden
If Err.Number <> 0 Then
Application.CommandBars(Symbolleistenname).Delete
Set CB = Application.CommandBars.Add(Name:= _
Symbolleistenname, temporary:=False, Position:=msoBarTop)
Set CMB = CB.Controls.Add(Type:=msoControlButton)
With CMB
.Caption = "Test"
.OnAction = "ShowallDrives"
End With
Set CMB = CB.Controls.Add(Type:=msoControlButton)
With CMB
.Caption = "Test2"
.OnAction = "ShowallDrives"
End With
CB.Visible = True
End If
End Sub