Je cherche un moyen de combiner en toute sécurité tout ce code. Le problème est répété BeforeClose noms à éviter. J'étais un peu confus comment contourner cela.
//plein écran
Private Sub Workbook_Open()
Application.DisplayFullScreen = True
Application.CommandBars("Full Screen").Visible = False
End Sub
Private Sub Workbook_BeforeClose(Cancel As Boolean)
Application.DisplayFullScreen = False
Application.CommandBars("Full Screen").Visible = True
End Sub
//barre de formule
Private Sub Workbook_BeforeClose(Cancel As Boolean)
Application.DisplayFormulaBar = True
End Sub
Private Sub Workbook_Open()
Application.DisplayFormulaBar = False
End Sub
// titres
Private Sub Workbook_BeforeClose(Cancel As Boolean)
Application.DisplayHeadings = True
End Sub
Private Sub Workbook_Open()
Application.DisplayHeadings = False
End Sub
//glisser déposer
Private Sub Workbook_AfterSave(ByVal Success As Boolean)
chgflag = "Y"
End Sub
Private Sub Workbook_BeforeClose(Cancel As Boolean)
If chgflag <> "Y" Then
MsgBox ("You are Closing this before Generating Your Target Docs")
End If
Application.CellDragAndDrop = True
End Sub
Private Sub Workbook_Open()
Application.CellDragAndDrop = False
End Sub
Merci beaucoup pour vos idées.
chgflag
variable publique que vous avez déclarée ailleurs?