"Application.Quit" Leaves Excel Running In The Background


Answer :

Before Excel 2016, Excel had the possibilities to have multiple Excel files in a single window.

In Excel 2016, it is one window per application.

The problem with your code is that it closes an instance. Based on the fact how the Excel files were opened, this would be either enough or not. E.g., if Excel files were opened in the same instance this would be quite enough.


A bit of an amateur myself and I realize this is a bit of an old thread, but I am wondering if you save the workbook (as you do) but also close the workbook and quit Excel, it may clear up the task manager. I notice you save the workbook but don't actually close the workbook, so it stays open. I ran into a similar issue before and I think this finally what fixed it.

This is code I use every time I want to quit Excel. Usually I have 2 books open, one is a template (which I don't save) and the other is one that was created with data from the template.

ActiveWorkbook.Close SaveChanges:=True Application.Quit ActiveWorkbook.Close SaveChanges:=False 

Comments

Popular posts from this blog

Are Regular VACUUM ANALYZE Still Recommended Under 9.1?

Can Feynman Diagrams Be Used To Represent Any Perturbation Theory?