[Tutor] problems with win32com.client and excel.
Thomi Richards
thomi at imail.net.nz
Tue Sep 2 20:21:16 EDT 2003
>
> To get past that error I had t add a comma after data:
>
> xl.adddata(['DATA',[['HEADER1','VALUE1'],['HEADER2','VALUE2'],['HEADER3','V
>ALUE3'],['HEADER4','VALUE','4']]])
>
DOH!!
It never ceases to amaze me what really *stupid* mistakes I make, and
compltely fail to notice them, until someone else notices... Not only is it
annoying, it's very embarrasing as well ;)
> [snip]
> Also I wonder why this line is not indented the same as xl = app(). This
> will not stop the program from working as long as its name is __main__, but
> if you import it, you'll get NameError: name 'xl' is not defined
>
In the original file it is, But my mail client wraps lines at 79 characters or
so, and so it wasn't pasted correctly...
> Even in PythonWin the program then gets the error you posted. The reason is
> that you are indexing Cells(0,1) and Excel Cell indexing starts at 1.
> I changed self.x = 0 to self.x = 1. Then I got yet another error that
> required me to change ['HEADER4','VALUE','4'] ot ['HEADER4','VALUE4'].
>
Yet another really dumb mistake I'm afraid *sigh*
Thank you every so much.. I was completely stuck ;)
Thanks again.
--
Thomi Richards,
http://once.sourceforge.net/
More information about the Tutor
mailing list