Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Close a workbook and then MS Excel?

Status
Not open for further replies.

thepunisher

Programmer
Jul 23, 2004
108
IE
Hi,

I am using the following code to save and then close a currently open workbook.

ActiveWorkbook.Save 'Save workbook.
ActiveWorkbook.Close 'Close workbook.

I also want to end the actual MS Excel Application, after the save and close have been done.

how do i do this?

thePunisher

Homer Simpson: Im not a religious man, but Superman, if you're up there, save me!!!
 
can't run code from the workbook you are closing after it has been closed so you would need to replace
activeworkbook.close with application.quit

If you are controlling one workbook from the other, then you can do as Molby suggests and tag that line on at the end

Rgds, Geoff

Yesterday it worked. Today it is not working. Windows is like that.

Please read FAQ222-2244 before you ask a question
 
Works like a charm.

Do you guys know anything about binary files?

Homer Simpson: Im not a religious man, but Superman, if you're up there, save me!!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top