PC Review


Reply
Thread Tools Rate Thread

How can I close Excel with a macro ?

 
 
Roger Ottaway
Guest
Posts: n/a
 
      23rd Nov 2003
I have Excel 2002 on Win XP. How can I close Excel with a macro.? In Access
I use a macro with Quit in it, this closes the database as well as Access.
Is there an equivalent in excel which will close the workbook and then Excel
itself ?



Thanks . Roger


 
Reply With Quote
 
 
 
 
Don Guillett
Guest
Posts: n/a
 
      23rd Nov 2003
application.quit

--
Don Guillett
SalesAid Software
(E-Mail Removed)
"Roger Ottaway" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> I have Excel 2002 on Win XP. How can I close Excel with a macro.? In

Access
> I use a macro with Quit in it, this closes the database as well as Access.
> Is there an equivalent in excel which will close the workbook and then

Excel
> itself ?
>
>
>
> Thanks . Roger
>
>



 
Reply With Quote
 
Gord Dibben
Guest
Posts: n/a
 
      23rd Nov 2003
Roger

Use this to close the workbook without saving

ThisWorkbook.Saved = True
Application.Quit

And this if you want to save it first

ThisWorkbook.Save
Application.Quit

If you want to suppress warnings preface wrap the code with

Application.DisplayAlerts = False

Gord Dibben XL2002


On Sun, 23 Nov 2003 16:35:06 +0100, "Roger Ottaway" <(E-Mail Removed)>
wrote:

>I have Excel 2002 on Win XP. How can I close Excel with a macro.? In Access
>I use a macro with Quit in it, this closes the database as well as Access.
>Is there an equivalent in excel which will close the workbook and then Excel
>itself ?
>
>
>
>Thanks . Roger
>


 
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
Close Excel with a Macro JHB Microsoft Excel Misc 2 7th Aug 2009 12:58 PM
close excel in macro RKormoski@gmail.com Microsoft Access Macros 1 13th Dec 2005 06:41 PM
Macro to close excel okanem Microsoft Excel Misc 1 19th Jul 2005 10:01 AM
macro to close excel =?Utf-8?B?UGFtIEM=?= Microsoft Excel Misc 1 5th May 2005 04:43 PM
Need macro help to close excel =?Utf-8?B?cXVpY2tsZWFybmVy?= Microsoft Excel Misc 3 27th Sep 2004 10:07 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:22 PM.