Sub interdit_MEP()
Application.CommandBars("Worksheet Menu Bar").Controls("&Fichier").Controls("Mise en Page...").Enabled = False
End Sub
Sub Autorise_MEP()
Application.CommandBars("Worksheet Menu Bar").Controls("&Fichier").Controls("Mise en Page...").Enabled = True
End Sub
Sub mise_en_page_interdite()
Application.CommandBars("Worksheet Menu Bar").Controls("&Fichier").Controls("Mise en Page...").Enabled = False
Application.CommandBars.FindControls(ID:=30255).Item(1).Enabled = False
Application.CommandBars.FindControls(ID:=109).Item(3).Enabled = False
End Sub
Sub mise_en_page_autorisée()
Application.CommandBars("Worksheet Menu Bar").Controls("&Fichier").Controls("Mise en Page...").Enabled = True
Application.CommandBars.FindControls(ID:=30255).Item(1).Enabled = True
Application.CommandBars.FindControls(ID:=109).Item(3).Enabled = True
End Sub
Sub test()
With ThisWorkbook
.CustomViews("toto").Show
.ActiveSheet.PrintOut
'Habituellement lorsque l'on détermine un affichage personnalisé
'on débute par définir un affichage "Normal", par la suite on peut
'définir autant de vue personnalisée que l'on désire d'une feuille.
.CustomViews("Normal").Show
End With
End Sub