Command Bars
A better solution to add custom buttons to the toolbar:
<MACRO CODE
Sub CreateOtherCommandBar_AddToolBarControlsEx2()
'Add toolbar controls
Dim ctrl
On Error Resume Next
Set ctrl = CommandBars(TBN).Controls("Sort Options") _
'.Controls("My Personal Tools ")
On Error GoTo 0
If ctrl Is Nothing Then
MsgBox "Control does not exist"
Else
With ctrl.Controls.Add(Type:=msoControlButton)
.Caption = "Btn 4"
End With
End If
End Sub
<MACRO CODE
|