[Tutor] Attempt to overwrite excel cell Python
Walter Prins
wprins at gmail.com
Tue Oct 12 03:49:44 CEST 2010
Hi Susana,
On 11 October 2010 21:08, Susana Iraiis Delgado Rodriguez <
susana.delgado_s at utzmg.edu.mx> wrote:
>
> *Exception*: *Attempt to overwrite cell*: sheetname='shp' rowx=1 colx=0,
> don't know what is wrong
>
>
This is a default of xlwt behaviour for writing Excel files. It assumes it
would generally be an unintended mistake to write a cell then overwrite it
later with something else hence it by default raises an exception when this
happens.
Anyway, you can override this behaviour and enable cell overwriting by
adding the parameter "cell_overwrite_ok=True" when you create a worksheet.
However I think you probably are just accidentally (and erroneously)
overwriting the same row accidentally, so the error is probably meaningful
in your case.
Wahtever the case, I've taken the liberty to knock what you posted into
shape a bi -- The following script now works (well it finds files and
doesn't generate the error you reported.) I've also tidied up the structure
and formatting as you'll see:
http://pastebin.com/Kc9N3DAC
Hope that helps,
Walter
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20101012/8cfd8fc0/attachment.html>
More information about the Tutor
mailing list