Option Explicit
Private Declare Sub keybd_event Lib "user32" ( _
ByVal bVk As Byte, ByVal bScan As Byte, ByVal dwFlags As Long, _
ByVal dwExtraInfo As Long)
Sub Quitter_Excel()
Application.ScreenUpdating = False
'Simule Ctrl+F1 (à lancer depuis la feuille de calcul)
Const VK_CONTROL = &H11
Const VK_F1 = &H70
Const KEYEVENTF_KEYUP = &H2
keybd_event VK_CONTROL, 0, 0, 0
keybd_event VK_F1, 0, 0, 0
keybd_event VK_F1, 0, KEYEVENTF_KEYUP, 0
keybd_event VK_CONTROL, 0, KEYEVENTF_KEYUP, 0
ActiveWindow.DisplayHeadings = True
Application.DisplayFormulaBar = True
Sheets("Tableau_de_bord").Select
ActiveWorkbook.Save
ThisWorkbook.Close
Application.ScreenUpdating = True
End Sub
Sub Quitter()
Application.ScreenUpdating = False
'Simule Ctrl+F1 (à lancer depuis la feuille de calcul)
Const VK_CONTROL = &H11
Const VK_F1 = &H70
Const KEYEVENTF_KEYUP = &H2
keybd_event VK_CONTROL, 0, 0, 0
keybd_event VK_F1, 0, 0, 0
keybd_event VK_F1, 0, KEYEVENTF_KEYUP, 0
keybd_event VK_CONTROL, 0, KEYEVENTF_KEYUP, 0
Application.DisplayFormulaBar = True
ActiveWindow.DisplayHeadings = True
Sheets("Tableau_de_bord").Select
ActiveWorkbook.Save
Application.Quit
Application.ScreenUpdating = True
End Sub