Sub Barre()
Application.ScreenUpdating = False
Dim maBarre As CommandBar
Dim monBouton As CommandBarButton
Set maBarre = CommandBars.Add(Name:="Alex", Position:=msoBarTop, MenuBar:=True)
'1
Set monBouton = maBarre.Controls.Add(msoControlButton)
monBouton.Style = msoButtonCaption
monBouton.Caption = "&Test Alex"
monBouton.OnAction = "Alexane"
maBarre.Protection = msoBarNoMove + msoBarNoCustomize
maBarre.Visible = True
End Sub
Sub ferm()
On Error Resume Next
CommandBars("Alex").Delete
End Sub
Sub Alexane()
MsgBox "coucou Alexane"
End Sub