1

When I use xlwings to automate stuff in excel, I still have EXCEL zoombie process running even if I quit the application (with wb.Application(wb).quit()).

Thus, when I try to re open my excel file that bugs. I have to manually kill the excel application.

edit : I use the xlwings 0.7.0

Coolpix
  • 503
  • 1
  • 6
  • 20

1 Answers1

2

The issue is that wb is a global reference to your workbook which still exists even after executing the quit command. Excel sees that it is being referenced (through COM) and thus refuses to shut down properly.

For now, you can manually clean up your workbook object after quitting: del wb. In the next major release of xlwings, we'll also provide a new Book.kill() command that will get around this issue.

Felix Zumstein
  • 6,737
  • 1
  • 30
  • 62
  • Thanks for the tips, I will try soon ! An other issue. If I close a Workbook and open an other right after, sometimes I get an error. If we delay the open of the second Workbook (for instance with time.sleep(0.05) we could bypass the problem. – Coolpix Jun 02 '16 at 15:22
  • Can you please open an issue on GitHub, much easier than trying to resolve things in comments here... – Felix Zumstein Jun 02 '16 at 16:05
  • This is old, but I didn't find any `Workbook.kill()` function and I get a bunch of zombie xlwings processes all the time. – SkyWalker Dec 13 '22 at 11:09
  • `Workbook` has been renamed early on in `Book`, edited accordingly. – Felix Zumstein Dec 13 '22 at 15:10