[python-win32] Excel "stopped working" after reading in sheet names

Mark Mordeca mark.mordeca at prosensus.ca
Tue May 31 18:48:54 CEST 2011


"Just a couple of quick answers, because I'm dashing off. One is that
we have code which uses the technique you're demonstrating to *write*
Excel dozens of times a day around the business and I'm not aware of
ever having seen the Crash Dialog. Obviously that doesn't necessarily
help your case, but it is a datapoint nonetheless."

Fair enough.  I wish I could track down what exactly was causing this
problem to appear.  Hopefully a reply from Mark or Roger could shed some
light.

" If all you're doing is reading data from Excel, you might want to
look at xlrd. Try the http://www.python-excel.org/ website. The
advantage is that you get a cross-platform, straight-to-the-data
API into Excel. The disadvantage is that it doesn't do everything
which you can achieve via COM."

When a user does not have Excel installed on their computer, we use xlrd
to read the Excel file.  However, the Excel files typically opened by the
application are very large, with potentially on the order of tens of
thousands of rows to be read in.  Xlrd was just not fast enough and so
that is why we opted for using COM if Excel was installed on the computer.
What took Xlrd a couple minutes to read in, only took the COM a minute or
less.

Thanks,
Mark

-----Original Message-----
From: python-win32-bounces+mark.mordeca=prosensus.ca at python.org
[mailto:python-win32-bounces+mark.mordeca=prosensus.ca at python.org] On
Behalf Of Tim Golden
Sent: Tuesday, May 31, 2011 11:38 AM
Cc: python-win32 at python.org
Subject: Re: [python-win32] Excel "stopped working" after reading in sheet
names

On 31/05/2011 16:26, Mark Mordeca wrote:
> Thanks for your reply Tim.

> If this is true, I hope to get some advice on how to correct the
problem.

...

Just a couple of quick answers, because I'm dashing off. One is that
we have code which uses the technique you're demonstrating to *write*
Excel dozens of times a day around the business and I'm not aware of
ever having seen the Crash Dialog. Obviously that doesn't necessarily
help your case, but it is a datapoint nonetheless.

If all you're doing is reading data from Excel, you might want to
look at xlrd. Try the http://www.python-excel.org/ website. The
advantage is that you get a cross-platform, straight-to-the-data
API into Excel. The disadvantage is that it doesn't do everything
which you can achieve via COM.

TJG
_______________________________________________
python-win32 mailing list
python-win32 at python.org
http://mail.python.org/mailman/listinfo/python-win32


More information about the python-win32 mailing list