How can I close Excel with a macro ?

  • Thread starter Thread starter Roger Ottaway
  • Start date Start date
R

Roger Ottaway

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
 
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
 
Back
Top