Closing Excel from VBA


Posted by Jason Daniels on November 08, 2000 3:14 PM

Does anyone know how to close excel from a macro. I know how to close a workbook, but am looking to automate some reporting (java calling excel with macros to format input file then save report out) and don't want to leave the excel process up all the time.

Thanks for your help!



Posted by Celia on November 09, 2000 12:00 AM


Jason
You should be able to close Excel with the following :-

Application.Quit
End

However, be careful. If you have add-ins that need to run some Auto_Close code, it might cause Excel to crash.
Also, do not put any code after Application.Quit since it will probably not be run.
So, if required, make sure you put code to save all workbooks before Application.Quit

Celia