[python-win32] excel termination

S. Smits j_h_m_smits at xs4all.nl
Wed Apr 14 06:36:39 EDT 2004


You have to close it in your script, something like this:

import win32com.client
class Excel:
    def __init__(self, filename=None):
          self.xlApp = win32com.client.Dispatch('Excel.Application')
          if filename:
              self.filename = filename
              self.xlBook = self.xlApp.Workbooks.Open(filename)
          else:
              self.xlBook = self.xlApp.Workbooks.Add()
              self.filename = ''

    def close(self):
          self.xlBook.Close(SaveChanges=1)
          del self.xlApp

Regards,
Sander Smits.

Op Wednesday 14 April 2004 12:09, schreef Guido Adriaensen:
> I have a problem, I have written a programme which opens excel,extracts
> some data from it and then again closes it. The problem is when I look in
> taskmanager I can still see the process (excel.exe). So it hasn't been
> closed, it is still running. I don't see it on my screen but it is still
> there. Does anybody know how to end this process in a proper manner.



More information about the Python-win32 mailing list