Private Sub Workbook_BeforeClose(Cancel As Boolean)
Application.ScreenUpdating = False
Dim Table() As String
Dim w As Workbook
Dim style As Integer
Dim msg As String, title As String, Response As String
msg = " ATTENTION ceci va quitter et enregistrer le Voulez vous continuer ?"
style = vbYesNo + vbDefaultButton2
title = "Attention!! "
Response = MsgBox(msg, style, title)
If Response = vbYes Then
'ThisWorkbook.Save
'Application.DisplayAlerts = False
'ThisWorkbook.Close
Application.DisplayAlerts = False
Application.ScreenUpdating = True
For Each w In Application.Workbooks
w.Save
Next w
Application.Quit
End If
Application.DisplayAlerts = False
End Sub