Const CBName = "Meine Makros"
Sub Symbolleiste_erstellen()
Call Symbolleiste_l�schen
CommandBars.Add Name:=CBName
With CommandBars(CBName)
.Position = msoBarTop
.Visible = True
.Controls.Add Type:=msoControlDropdown
End With
With CommandBars(CBName).Controls(1)
.Caption = CBName
.AddItem "Routine 1"
.AddItem "Routine 2"
.AddItem "Routine 3"
.ListIndex = 1
.OnAction = "MachWas"
.TooltipText = "Meine Routinen..."
End With
End Sub
Sub Symbolleiste_l�schen()
On Error Resume Next
CommandBars(CBName).Delete
End Sub
Sub MachWas()
Dim objList As CommandBarControl
Dim Auswahl As Byte
Set objList = CommandBars.ActionControl
Auswahl = objList.ListIndex
Select Case Auswahl
Case 1:
MsgBox "Routine 1", vbExclamation
Case 2:
MsgBox "Routine 2", vbExclamation
Case 3:
MsgBox "Routine 3", vbExclamation
End Select
End Sub
|