Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / New Users / January 2008

Tip: Looking for answers? Try searching our database.

Save All...

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
stef - 22 Jan 2008 22:22 GMT
Excel 2002 SP3
Win XP Pro SP2

Hi,

Is there a way to do a Save All (all opened files) in a similar fashion
as clicking Shift|File|Close All ?

Failing that, any macros out there I could use?

Thanks a million!
Don Guillett - 22 Jan 2008 22:36 GMT
Here is one I use to save and close all opened files including the file
housing the macro and leaving excel.

Sub CLOSE_ALL()
Application.ScreenUpdating = False
Application.DisplayAlerts = False
For Each w In Application.Workbooks
If w.Name <> ThisWorkbook.Name Then
  w.Save
w.Close
'    w.Close SaveChanges:=True
'MsgBox w.Name
End If
Next w
ThisWorkbook.Save
Application.Quit
End Sub

Signature

Don Guillett
Microsoft MVP Excel
SalesAid Software
dguillett1@austin.rr.com

> Excel 2002 SP3
> Win XP Pro SP2
[quoted text clipped - 7 lines]
>
> Thanks a million!
stef - 22 Jan 2008 22:53 GMT
Don,
Thanks, very useful.

I would like to have a separate macro or action to just Save All but not
CLOSE the files, IOW continue to work with them.

Anything?

> Here is one I use to save and close all opened files including the file
> housing the macro and leaving excel.
[quoted text clipped - 13 lines]
> Application.Quit
> End Sub
Don Guillett - 22 Jan 2008 23:02 GMT
Just comment out or delete the w.close line

Signature

Don Guillett
Microsoft MVP Excel
SalesAid Software
dguillett1@austin.rr.com

> Don,
> Thanks, very useful.
[quoted text clipped - 21 lines]
>> Application.Quit
>> End Sub
stef - 23 Jan 2008 00:37 GMT
Don,
Doesn't work. It closes and exits anyway....
I must be doing something wrong....
How should the code be then?

Like this?

Application.ScreenUpdating = False
Application.DisplayAlerts = False
For Each w In Application.Workbooks
If w.Name <> ThisWorkbook.Name Then
  w.Save
'    w.Save SaveChanges:=True
'MsgBox w.Name
End If
Next w
ThisWorkbook.Save
Application.Quit
End Sub

> Just comment out or delete the w.close line
Dave Peterson - 23 Jan 2008 00:53 GMT
Application.quit
will close excel.

Remove that line, too.

> Don,
> Doesn't work. It closes and exits anyway....
[quoted text clipped - 17 lines]
>
> > Just comment out or delete the w.close line

Signature

Dave Peterson

stef - 23 Jan 2008 01:00 GMT
Right, thanks.
I was too focused on the code above to even notice that....
I'm losing it ;)

> Application.quit
> will close excel.
[quoted text clipped - 22 lines]
>>
>>> Just comment out or delete the w.close line
Dave Peterson - 23 Jan 2008 02:23 GMT
That never happens to me <vvbg>.

> Right, thanks.
> I was too focused on the code above to even notice that....
[quoted text clipped - 26 lines]
> >>
> >>> Just comment out or delete the w.close line

Signature

Dave Peterson

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.