Clsong Excel

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,
' Save And Close
ActiveWindow.Close savechanges:=True

this closes and saves to workbook but leaves Excel still running, I want to
close Excel as well.

Any ideas

MarkS
 
Mark,
For your information your code does not necessarily close and save the
workbook.
If the workbook only has a single window, then it does as you expect,
otherwise it only closes the activewindow.

You should use one of these, depending on the location of the code and what
you require:
ActiveWorkbook.Close True
ThisWorkbook.Close True
Workbooks(1).Close True
Workbooks("Somename.xls").Close True

As for closing Excel
Application.Quit

although you may get prompted it other WBs are open/changes made.

NickHK
 
Hi,
Not quit what I wanted but this does work

ThisWorkbook.Save
Application.Quit
 

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

Back
Top