[python-win32] win32com client Workbooks.Open throws exeption
John Machin
sjmachin at lexicon.net
Thu Aug 19 07:14:35 CEST 2010
On 19/08/2010 4:00 AM, Tim Roberts wrote:
> @©ħα® wrote:
>> Workbooks.Open fails randomly throws an exception
>> ...
>> calling logToXLS() occasionally throws the mentioned error at
>>
>> xl.Workbooks.Open(filePath)
>>
>> File "C:\Python25\Lib\site-packages\win32com\client\dynamic.py",
>>
>> line 496, in
>> __getattr__
>> raise AttributeError, "%s.%s" % (self._username_, attr)
>> AttributeError: Excel.Application.Workbooks
>>
>>
>> 1)is there any limitation on number of characters on filepath?
>> 2)How this issue can be overcome?
>
> That's not saying that the Open call failed. That's saying that the
> Workbooks object did not contain a function called "Open", which is much
> stranger. Have you used makepy on the Office components to create
> wrappers for them? Is this running in an application or in a service?
> Is it possible, when this happens, that your user already has Excel open
> doing something else? (Although I don't quite know how that would lead
> to this.)
>
Tim: I think it's saying that Excel.Application does not have an
attribute "Workbooks", which is equally strange.
OP: Which build of pywin32 are you running? Have you tried a later build?
More information about the python-win32
mailing list