Thread: Command Bars
View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
jfcby jfcby is offline
external usenet poster
 
Posts: 33
Default 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