J
jfcby
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, Before:=1)
.Caption = "Menu 1"
With .Controls.Add(Type:=msoControlButton, Before:=1)
.Caption = "Btn 1"
End With
With .Controls.Add(Type:=msoControlButton, Before:=2)
.Caption = "Btn 2"
End With
End With
End With
End Sub
Thank you for your help,
jfcby
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, Before:=1)
.Caption = "Menu 1"
With .Controls.Add(Type:=msoControlButton, Before:=1)
.Caption = "Btn 1"
End With
With .Controls.Add(Type:=msoControlButton, Before:=2)
.Caption = "Btn 2"
End With
End With
End With
End Sub
Thank you for your help,
jfcby