View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Claus Busch Claus Busch is offline
external usenet poster
 
Posts: 3,872
Default Close all without saving and exit without prompts

hi Colin,

Am Sun, 17 Nov 2013 14:50:16 +0000 schrieb Colin Hayes:

I'm trying to find a macro to close all open worksheets without saving
and exit Excel without prompts.


try:

Sub Test()
Dim wbk As Workbook

For Each wbk In Workbooks
If wbk.Name < ThisWorkbook.Name Then
wbk.Close savechanges:=False
End If
Next
With Application
.DisplayAlerts = False
.Quit
.DisplayAlerts = True
End With
End Sub


Regards
Claus B.
--
Win XP PRof SP2 / Vista Ultimate SP2
Office 2003 SP2 /2007 Ultimate SP2