View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Don Guillett[_4_] Don Guillett[_4_] is offline
external usenet poster
 
Posts: 2,337
Default Ah, I think...

does this help
Sub CLOSE_ALL()
Application.ScreenUpdating = False
Application.DisplayAlerts = False
For Each w In Workbooks
w.Save
Next
Application.Quit
End Sub
Sub goaway()

--
Don Guillett
SalesAid Software
Granite Shoals, TX

"Arne" wrote in message
...
that precautions must be taken to close the workbook that
contains the macro is closed before the other workbooks
have been closed.
Try:

Dim wkb As Workbook
Application.DisplayAlerts = False
For Each wkb In Workbooks
If Not (wkb Is ThisWorkbook) Then
wkb.Close SaveChanges:=False
End If
Next wkb
ThisWorkbook.Close SaveChanges:=False

HTH