OVH Cloud OVH Cloud

cacher les barres d'outils le retour

3 réponses
Avatar
Zoltan
Salut à tous,

pour cacher mes barres d'outils à l'ouverture d'un fichier j'ai ça :
Private Sub Workbook_Open()
Application.OnKey "~", "touche_Entree"
Application.OnKey "{ENTER}", "touche_Entree"
Application.ScreenUpdating = False
Application.DisplayFullScreen = True
Application.CommandBars(1).Enabled = False
ActiveWindow.DisplayHeadings = False
Application.ActiveWindow.DisplayHorizontalScrollBar = False
Application.ActiveWindow.DisplayVerticalScrollBar = False
ThisWorkbook.Sheets("Saisie").ScrollArea = "A1:E20"
End Sub

ça fonctionne sauf pour la barre d'outils ou se trouvent les boutons
nouveau dossier, ouvrir, enregistrer, imprimer etc.
quelle est la commande pour la cacher?

merci encore



--
http://perso.wanadoo.fr/aquabidule/
http://www.rouhling.net
http://www.aquariumdudiscus.fr

3 réponses

Avatar
sabatier
bonsoir zoltan
peut-être en rajoutant...

Application.CommandBars(3).Enabled = False

jps

Zoltan a écrit:
Salut à tous,

pour cacher mes barres d'outils à l'ouverture d'un fichier j'ai ça :
Private Sub Workbook_Open()
Application.OnKey "~", "touche_Entree"
Application.OnKey "{ENTER}", "touche_Entree"
Application.ScreenUpdating = False
Application.DisplayFullScreen = True
Application.CommandBars(1).Enabled = False
ActiveWindow.DisplayHeadings = False
Application.ActiveWindow.DisplayHorizontalScrollBar = False
Application.ActiveWindow.DisplayVerticalScrollBar = False
ThisWorkbook.Sheets("Saisie").ScrollArea = "A1:E20"
End Sub

ça fonctionne sauf pour la barre d'outils ou se trouvent les boutons
nouveau dossier, ouvrir, enregistrer, imprimer etc.
quelle est la commande pour la cacher?

merci encore





Avatar
Zoltan
Application.CommandBars(3).Enabled = False
ah, comme je le disais plus loin, parfois je suis tellement

dans mes procédures que j'en oublie les choses si simple
d'excel, à savoir un clic droit sur la barre qui ne veut pas partir
et décocher "Standard"

merci quand même
j'aurais appris que chaque barre d'outils porte un n°

Avatar
ChrisV
Bonjour Zoltan,

j'aurais appris que chaque barre d'outils porte un n°


Un index, un nom, un type... ;-)

Sub nomBO()
Application.ScreenUpdating = False
lgn = 1
For Each cbar In Application.CommandBars
Cells(lgn, 1) = cbar.Index
Cells(lgn, 2) = cbar.Name
Select Case True
Case cbar.Type = 0
Cells(lgn, 3) = "barre d'outils"
Case cbar.Type = 1
Cells(lgn, 3) = "barre de menus"
Case cbar.Type = 2
Cells(lgn, 3) = "menu contextuel"
End Select
lgn = lgn + 1
Next cbar
Columns("A:B").EntireColumn.AutoFit
End Sub


ChrisV


"Zoltan" a écrit dans le message de news:
u#
Application.CommandBars(3).Enabled = False
ah, comme je le disais plus loin, parfois je suis tellement

dans mes procédures que j'en oublie les choses si simple
d'excel, à savoir un clic droit sur la barre qui ne veut pas partir
et décocher "Standard"

merci quand même
j'aurais appris que chaque barre d'outils porte un n°