Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
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



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 04:38 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"