1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55
|
Sub Auto_Open()
Call Creation_Barres_Consolidation
end sub
Sub Creation_Barres_Consolidation()
Dim BAR As Variant
Application.ScreenUpdating = False
On Error Resume Next
For Each BAR In Application.CommandBars
If Not BAR.BuiltIn And BAR.Visible Then BAR.Delete
Next
Set barre1 = CommandBars.Add(Name:="Labarre", Position:=msoBarTop, MenuBar:=True, temporary:=True)
'affichage_barres()
For Each cbar In CommandBars
Test = cbar.Index
If CommandBars("Labarre").Visible = True Then
CommandBars("Labarre").Enabled = False
End If
Next
barre1.Visible = True
CommandBars("Labarre").Visible = True
'ajout barres de menus
Set menu1 = barre1.Controls.Add(Type:=msoControlPopup) 'Sauvegarde
Set menu6 = barre1.Controls.Add(Type:=msoControlPopup) 'Modification
Set menu7 = barre1.Controls.Add(Type:=msoControlPopup) 'Impression
' ajout_sous_menus
Set opt11 = menu1.Controls.Add(Type:=msoControlButton, ID:=3) 'Sauvegarde
Set opt61 = menu6.Controls.Add(Type:=msoControlButton, ID:=47) 'Rendre visible tous les onglets
Set opt71 = menu7.Controls.Add(Type:=msoControlButton, ID:=37) 'Retour Menu Excel
'INTITULE DES SOUS MENUS
' Saisie
menu1.Caption = "SAUVEGARDE"
opt11.Caption = "Sauvegarde"
' Encadrement
menu6.Caption = "AFFICHER"
opt61.Caption = "Rendre visible tous les onglets"
' Retour
menu7.Caption = "RETOUR"
opt71.Caption = "Retour au Menu Excel"
' ATTRIBUTION DES PROCEDURES
opt11.OnAction = "Enregistrer"
opt61.OnAction = "RendreVisible"
opt71.OnAction = "Retour"
Application.ScreenUpdating = True
End Sub |
Partager