Thread: Command Bars
View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
jfcby jfcby is offline
external usenet poster
 
Posts: 33
Default Command Bars

With the macro below is there a way to add a custom button to the
Toolbar without deleing then recreating it?

Sub CreateOtherCommandBar_Test1()
On Error Resume Next
Application.CommandBars(TBN).Delete
On Error GoTo 0
With Application.CommandBars.Add
.Name = TBN
.Visible = True
With .Controls.Add(Type:=msoControlPopup, Befo=1)
.Caption = "Menu 1"
With .Controls.Add(Type:=msoControlButton, Befo=1)
.Caption = "Btn 1"
End With
With .Controls.Add(Type:=msoControlButton, Befo=2)
.Caption = "Btn 2"
End With
End With
End With
End Sub

Thank you for your help,
jfcby