win32com Excel problem

Mike Brenner mikeb at mitre.org
Mon May 27 20:06:57 EDT 2002


Tom Wiencko <tew at wiencko.com> wrote:

># old method I don't use any more
>        def getCell(self,row,col,sheet=None):
> ...
>
># new method I use exclusively
>        def getRange(self,row1,col1,row2,col2,sheet=None):


I can't verify your failure, but I can attest to the fact that reading in a large rectangle is tremendously faster than reading in one cell at a time. There is a large overhead for each call to Cells.

That same observation holds for reading the Interior.Color and the Boundaries(Top).Color. If you want to read a block of colors, copy the block to another block; then set the value of that new block in Visual Basic to each cells Interior.Color; then, from python read in the whole block. Same for the boundaries (I use the top boundary color of each cell). 

It would be nice to control this, especially for colors and boundaries which do not have a corresponding block method available to Python.






More information about the Python-list mailing list