os.system('TASKKILL /F /IM EXCEL.exe') in python

Viewed 1910

I am using os.startfile(excel file) to open excel application. After running task kill, when I try to open excel again it gives me recovery options.

Is there any way to open the excel application and close it properly without giving recovery option when I open it again?

1 Answers

with the argument /F you force kill the program, not giving it time to save things or clear memory etc. what os.system('taskkill /T /IM EXCEL.exe) does is it sends the same singnal as the program gets when you press the close program button

Related