[python-win32] Writing to Excel performance

Dahlstrom, Roger rdahlstrom at directedge.com
Fri Dec 12 15:58:26 CET 2008


Couple of tricks I've used with some success...

1.  If this is data only, and not formulas, you can write the data as an html table, but name the file something.xls - Excel will open it natively.
2.  If you need special formatting or formulas, you can write the data as Excel's HTML templates (make a sample file in Excel, save it as html, then you can see how to do it)

I believe #1 to be a security flaw in windows - that you can just name a file anything, and the application will open it, but anyway, it works, and is fairly fast.

________________________________
From: python-win32-bounces+rdahlstrom=directedge.com at python.org [mailto:python-win32-bounces+rdahlstrom=directedge.com at python.org] On Behalf Of Dominick Lauzon
Sent: Friday, December 12, 2008 9:54 AM
To: python-win32 at python.org
Subject: [python-win32] Writing to Excel performance

Hi,

I have large matrices of data to push to excel and I find the writing of data to excel to be excessively slow (cell by cell method) even if the Visible is to False.

Right now I reverted back to a 2 step CSV - Import to Excel but it is far from ideal.

Is there any trick to accumulate the data and push it to Excel all at once or any other way to improve performance altogether ?

Any guidance would be appreciated.


Domnick Lauzon
















DISCLAIMER:
This e-mail, and any attachments thereto, is intended only for use by the addressee(s) named herein and
may contain legally privileged and/or confidential information. If you are not the intended recipient
of this e-mail, you are hereby notified that any dissemination, distribution or copying of this e-mail, and 
any attachments thereto, is strictly prohibited. If you have received this in error, please immediately notify 
me and permanently delete the original and any copy of any e-mail and any printout thereof. 
E-mail transmission cannot be guaranteed to be secure or error-free. The sender therefore does not accept 
liability for any errors or omissions in the contents of this message which arise as a result of e-mail transmission.

NOTICE REGARDING PRIVACY AND CONFIDENTIALITY
Direct Edge ECN LLC may, at its discretion, monitor and review the content of all e-mail communications.

www.directedge.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-win32/attachments/20081212/48d840f8/attachment.htm>


More information about the python-win32 mailing list