ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Ah, I think... (https://www.excelbanter.com/excel-programming/271049-re-ah-i-think.html)

Don Guillett[_4_]

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





All times are GMT +1. The time now is 09:37 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com