Mit folgenden Code kann ich über Button-Click eine symbolleiste anlegen:
'symbolleiste anlegen
Dim symbolleiste As Object
Dim symbol As CommandBarControl
On Error Resume Next
Set symbolleiste = CommandBars.Add
With symbolleiste
.Name = "Thomas"
.Visible = True
.Left = 540
.Top = 55
End With
With Application.CommandBars("Thomas")
Set symbol = .Controls.Add( _
Type:=msoControlButton, ID:=3, _
before:=.Controls.Count + 1, _
Temporary:=True)
End With
With Application.CommandBars("Thomas")
Set symbol = .Controls.Add( _
Type:=msoControlButton, ID:=4, _
before:=.Controls.Count + 1, _
Temporary:=True)
End With
With Application.CommandBars("Thomas")
Set symbol = .Controls.Add( _
Type:=msoControlButton, ID:=109, _
before:=.Controls.Count + 1, _
Temporary:=True)
End With
Wenn ich diesen Code jedoch mit Workbook_Open() einsetze wird die symbolleiste nicht generiert. Kann mir wer sagen warum das so ist?
LG
Thomas