automating excel with python ... getting excel to go away

Scott Hathaway slhath at home.com
Thu Dec 28 17:30:31 EST 2000


Hello,

I am trying to automate excel with python.  Here is my code:

 import win32com.client, os
 myExcel = win32com.client.Dispatch('Excel.Application')
 myExcel.Workbooks.Open('c:\\test.html')
 myExcel.Visible = 0
try:
  os.remove(newReport)
 except:
  pass
 myExcel.ActiveWorkbook.SaveAs('c:\\test.xls)
 myExcel.Quit
 myExcel = None

This code works fine, in that the HTML file is converted to xls and saved,
but the problem is that excel is still running in the background when the
script is through.  How can I get excel to go away?

Thanks,
Scott





More information about the Python-list mailing list