[python-win32] Pywin32-Excel Range/Cells problems

Sylvain Fauveau (apli-agipa) info at apli-agipa.com
Tue Mar 16 09:10:05 CET 2010


Tim Roberts a écrit :
> Sylvain Fauveau (apli-agipa) wrote:
>   
>> sheet.Range('A1:C1').Value = ['test','test'*400,'test']
>> doesn't work :
>> pywintypes.com_error(-2147352567,"Une exception s'est produite.", (0,
>> None, None, None, 0, -2416827284), None)
>>     
>
> It's always dangerous to retype lines like these instead of cutting and
> pasting, because it's so easy to mistype the error number.  In this
> case, the error is actually -2146827284, which would be 800A03EC
> (ERROR_INVALID_FLAGS), but that isn't a typical Excel error code.
>   
Hello Tim. Thanks for your answer.

You're right. Copy and paste error message :
 >>> sheet.Range('A1:C1').Value = ['test','test'*400,'test']
Traceback (most recent call last):
File "<interactive input>", line 1, in <module>
File "C:\usr\Python25\lib\site-packages\win32com\client\__init__.py", 
line 463, in __setattr__
self._oleobj_.Invoke(*(args + (value,) + defArgs))
com_error: (-2147352567, "Une exception s'est produite.", (0, None, 
None, None, 0, -2146827284), None)
 >>>
> For what it's worth, it works up through 911 characters and fails on
> 912.  That's odd.  I wonder if this is a request-length restriction in
> the marshalling code.
>   
So you can reproduce it, but with which version of python/pywin32 ?

Best regards
-- 

*Sylvain Fauveau*
Apli-Agipa
Tél: 03-26-58-18-28
Logo d'APLI-AGIPA
--Pensez à la nature et n’imprimez cet email que si nécessaire--

-------------- next part --------------
A non-text attachment was scrubbed...
Name: info.vcf
Type: text/x-vcard
Size: 176 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/python-win32/attachments/20100316/459a7d9b/attachment.vcf>


More information about the python-win32 mailing list