Fermer Excel.exe complètement.

tatayoyo38

XLDnaute Nouveau
Bonjour,
J'utilise ce code pour fermer Excel :

Code:
Private Sub Workbook_BeforeClose(Cancel As Boolean)

ActiveWindow.DisplayGridlines = True
ActiveWindow.DisplayHeadings = True
ActiveWindow.DisplayHorizontalScrollBar = True
ActiveWindow.DisplayWorkbookTabs = True
Application.DisplayFullScreen = False

Application.DisplayFormulaBar = True
Application.DisplayStatusBar = True
Application.WindowState = xlMaximized
Application.ScreenUpdating = True

Application.Quit

End Sub

Surtout la derniere ligne en fait.
Seul soucit, il reste afficher dans mon Task Manager et comme je lance excel via un fichier bat le fichier bat ne peut pas continuer car il attend la fermeture de excel.

Comment faire ?
Merci a tous.
 

tatayoyo38

XLDnaute Nouveau
Re : Fermer Excel.exe complètement.

Voila la soluce ^^ lol :

Code:
Dim ChClose$
ChClose = ActiveWorkbook.Path & "\"
Call Shell(Environ$("COMSPEC") & " /k" & """ & ChClose & """ & "Close.bat", vbNormalFocus)

EDIT : En fait non, le bat m'affciche & était innatendu. ^^
 
Dernière édition:

Discussions similaires

Statistiques des forums

Discussions
312 229
Messages
2 086 426
Membres
103 206
dernier inscrit
diambote