Macro to close Excel 2007

R

Ralph

How do I close out of Excel completely? I've tried this:
Sub Macro1()
'
' Macro1 Macro
' Save and close workbook
'
ActiveWorkbook.Save
ActiveWorkbook.Close

this only closes the active workbook and I need to close Excel completely.

thanks
 
G

Gord Dibben

Sub Macro1()

ActiveWorkbook.Save
Application.Quit

End Sub


Gord Dibben MS Excel MVP
 

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

Similar Threads


Top