Is there a function for closing Excel using VB?

G

Guest

I have created a macro that saves the current worksheet to a specified
location with a specified name and then closes the worksheet. I would like
to be able to close the Excel application itself from the macro.

Can anyone tell me how?
 
D

Dave Patrick

Application.Quit

--
Regards,

Dave Patrick ....Please no email replies - reply in newsgroup.
Microsoft Certified Professional
Microsoft MVP [Windows]
http://www.microsoft.com/protect

:
|I have created a macro that saves the current worksheet to a specified
| location with a specified name and then closes the worksheet. I would
like
| to be able to close the Excel application itself from the macro.
|
| Can anyone tell me how?
 
G

Guest

Thanks Dave.

Funny thing is that Application.Quit does not work if it is preceeded by
ActiveWorkbook.Close
 
D

Dave Patrick

Once the workbook is closed the code that is/was running terminates. You
shouldn't need that line.

--
Regards,

Dave Patrick ....Please no email replies - reply in newsgroup.
Microsoft Certified Professional
Microsoft MVP [Windows]
http://www.microsoft.com/protect

:
| Thanks Dave.
|
| Funny thing is that Application.Quit does not work if it is preceeded by
| ActiveWorkbook.Close
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top