Answer the question
In order to leave comments, you need to log in
Why does Microsoft Excel hang in the process list after manually closing it?
Create a new Excel document to print documents
excelApplication = new Excel.Application();
excelApplication.DisplayAlerts = true;
excelApplication.WindowState = Excel.Enums.XlWindowState.xlMaximized;
excelApplication.Visible = true;
excelApplication.Quit();
excelApplication.Dispose();
Answer the question
In order to leave comments, you need to log in
Obviously, if the program is not closed, it will remain unclosed. You create a process programmatically, so a user's "shutdown" means nothing to it, it waits to be sent a programmatically close command. As an option, you can try to determine the sign that the user has closed and then exit programmatically, or open excel in another way, for example, through Process
Here you wrote to close the program, here it is:
excelApplication.Quit();
excelApplication.Dispose();
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question