PC Review


Reply
Thread Tools Rate Thread

Close all workbooks and keep excel running

 
 
Scott Hutslar
Guest
Posts: n/a
 
      25th Jun 2008
Is there a way to close all workbooks without exiting excel? I have found
where you can exit excel and it will close all workbooks. I have a scenario
where it is desirable to close all open workbooks and keep excel running.

Anyone know of a way of doing this without closing each workbook individually?
 
Reply With Quote
 
 
 
 
Tim879
Guest
Posts: n/a
 
      25th Jun 2008
You can use this macro:
Sub Close_All_Open_Workbooks()
Dim I

For I = 1 To Application.Workbooks.Count
Application.Workbooks(I).Close
Next

End Sub


On Jun 25, 8:49*am, Scott Hutslar <Scott
(E-Mail Removed)> wrote:
> Is there a way to close all workbooks without exiting excel? *I have found
> where you can exit excel and it will close all workbooks. *I have a scenario
> where it is desirable to close all open workbooks and keep excel running.*
>
> Anyone know of a way of doing this without closing each workbook individually?


 
Reply With Quote
 
 
 
 
Scott Hutslar
Guest
Posts: n/a
 
      25th Jun 2008
Thanks for the reply Tim. This is a good way of doing this if we create a
global macro for all users to execute. Is there a way provided by Excel for
an end user to do this? I guess I am looking for a Ribbon path for doing
this.

"Tim879" wrote:

> You can use this macro:
> Sub Close_All_Open_Workbooks()
> Dim I
>
> For I = 1 To Application.Workbooks.Count
> Application.Workbooks(I).Close
> Next
>
> End Sub
>
>
> On Jun 25, 8:49 am, Scott Hutslar <Scott
> (E-Mail Removed)> wrote:
> > Is there a way to close all workbooks without exiting excel? I have found
> > where you can exit excel and it will close all workbooks. I have a scenario
> > where it is desirable to close all open workbooks and keep excel running.
> >
> > Anyone know of a way of doing this without closing each workbook individually?

>
>

 
Reply With Quote
 
Thomas [PBD]
Guest
Posts: n/a
 
      25th Jun 2008
Scott,

Does File>Close not work for this purpose? It will close all open Workbooks
and leave the Excel application open.

--
--Thomas [PBD]
Working hard to make working easy.


"Scott Hutslar" wrote:

> Thanks for the reply Tim. This is a good way of doing this if we create a
> global macro for all users to execute. Is there a way provided by Excel for
> an end user to do this? I guess I am looking for a Ribbon path for doing
> this.
>
> "Tim879" wrote:
>
> > You can use this macro:
> > Sub Close_All_Open_Workbooks()
> > Dim I
> >
> > For I = 1 To Application.Workbooks.Count
> > Application.Workbooks(I).Close
> > Next
> >
> > End Sub
> >
> >
> > On Jun 25, 8:49 am, Scott Hutslar <Scott
> > (E-Mail Removed)> wrote:
> > > Is there a way to close all workbooks without exiting excel? I have found
> > > where you can exit excel and it will close all workbooks. I have a scenario
> > > where it is desirable to close all open workbooks and keep excel running.
> > >
> > > Anyone know of a way of doing this without closing each workbook individually?

> >
> >

 
Reply With Quote
 
Scott Hutslar
Guest
Posts: n/a
 
      25th Jun 2008
Thanks Thomas. Close just closes the current (active) workbook. But your
suggestion prompted me to customize my tool bar and add a "Close All" button.
This can be found in the commands "Not in the Ribbon".

Thanks everyone for your help!

"Thomas [PBD]" wrote:

> Scott,
>
> Does File>Close not work for this purpose? It will close all open Workbooks
> and leave the Excel application open.
>
> --
> --Thomas [PBD]
> Working hard to make working easy.
>
>
> "Scott Hutslar" wrote:
>
> > Thanks for the reply Tim. This is a good way of doing this if we create a
> > global macro for all users to execute. Is there a way provided by Excel for
> > an end user to do this? I guess I am looking for a Ribbon path for doing
> > this.
> >
> > "Tim879" wrote:
> >
> > > You can use this macro:
> > > Sub Close_All_Open_Workbooks()
> > > Dim I
> > >
> > > For I = 1 To Application.Workbooks.Count
> > > Application.Workbooks(I).Close
> > > Next
> > >
> > > End Sub
> > >
> > >
> > > On Jun 25, 8:49 am, Scott Hutslar <Scott
> > > (E-Mail Removed)> wrote:
> > > > Is there a way to close all workbooks without exiting excel? I have found
> > > > where you can exit excel and it will close all workbooks. I have a scenario
> > > > where it is desirable to close all open workbooks and keep excel running.
> > > >
> > > > Anyone know of a way of doing this without closing each workbook individually?
> > >
> > >

 
Reply With Quote
 
Gord Dibben
Guest
Posts: n/a
 
      25th Jun 2008
In earlier versions CTRL + w closed all workbooks but user is asked about
saving.


Gord Dibben MS Excel MVP

On Wed, 25 Jun 2008 06:10:01 -0700, Scott Hutslar
<(E-Mail Removed)> wrote:

>Thanks for the reply Tim. This is a good way of doing this if we create a
>global macro for all users to execute. Is there a way provided by Excel for
>an end user to do this? I guess I am looking for a Ribbon path for doing
>this.
>
>"Tim879" wrote:
>
>> You can use this macro:
>> Sub Close_All_Open_Workbooks()
>> Dim I
>>
>> For I = 1 To Application.Workbooks.Count
>> Application.Workbooks(I).Close
>> Next
>>
>> End Sub
>>
>>
>> On Jun 25, 8:49 am, Scott Hutslar <Scott
>> (E-Mail Removed)> wrote:
>> > Is there a way to close all workbooks without exiting excel? I have found
>> > where you can exit excel and it will close all workbooks. I have a scenario
>> > where it is desirable to close all open workbooks and keep excel running.
>> >
>> > Anyone know of a way of doing this without closing each workbook individually?

>>
>>


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I close all workbooks and exit excel with one click? Glen@DFR Microsoft Excel Misc 5 10th Jul 2008 03:46 PM
why do all excel worksheets/workbooks close when I close one? =?Utf-8?B?UGVubnk=?= Microsoft Excel Misc 1 29th Nov 2006 04:49 AM
Microsoft Speech Recognition repeating error "all all all all all all...." kenrosen@gmail.com Windows XP General 1 17th Dec 2005 03:22 AM
Microsoft Speech Recognition repeating error "all all all all all all...." kenrosen@gmail.com Windows XP Help 0 16th Dec 2005 07:39 PM
Excel 2003 Workbooks.Open with CorruptLoad=xlRepairFile fails on Excel 5.0/95 file due to Chart, with Error 1004 Method 'Open' of object 'Workbooks' failed Frank Jones Microsoft Excel Programming 2 15th Jun 2004 03:21 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:17 AM.