CommandBars.FindControl
Steffen
Hallo Zusammen,
Ich möchte in einem Programm Standard Befehle(Speichern,Füllfarbe,Schriftgrad usw.) in der Menüleiste festlegen .
mit folgenden Script hab ich es versucht erst zuprüfen ob erschon vorhanden ist u wenn nicht soll er eingefügt werden.
Sub steuerl()
If Not CommandBars(1).FindControl(ID:=1728).Enabled Then
Application.CommandBars("Worksheet Menu Bar").Controls.Add Type:= _
msoControlButton, ID:=1728, Before:=10
End If
If Not CommandBars(1).FindControl(ID:=1731).Enabled Then
Application.CommandBars("Worksheet Menu Bar").Controls.Add Type:= _
msoControlButton, ID:=1731, Before:=10
End If
If Not CommandBars(1).FindControl(ID:=401).Enabled Then
Application.CommandBars("Worksheet Menu Bar").Controls.Add Type:= _
msoControlButton, ID:=401, Before:=10
End If
If Not CommandBars(1).FindControl(ID:=3).Enabled Then
Application.CommandBars("Worksheet Menu Bar").Controls.Add Type:= _
msoControlButton, ID:=113, Before:=10
End If
If Not CommandBars(1).FindControl(ID:=1691).Enabled Then
Application.CommandBars("Worksheet Menu Bar").Controls.Add Type:= _
msoControlButton, ID:=1691, Before:=9
End If
If Not CommandBars(1).FindControl(ID:=401).Enabled Then
Application.CommandBars("Worksheet Menu Bar").Controls.Add Type:= _
msoControlButton, ID:=401, Before:=10
End If
If Not CommandBars(1).FindControl(ID:=3).Enabled Then
Application.CommandBars("Worksheet Menu Bar").Controls.Add Type:= _
msoControlButton, ID:=3, Before:=10
End If
End Sub
die bringt mir aber ein Laufzeitfehler.
Ich vermute mal das es an der Eigenschaft Enabled liegt.
Viele Grüße Steffen