[python-win32] win32com client Workbooks.Open throws exeption

Tim Roberts timr at probo.com
Wed Aug 18 20:00:10 CEST 2010


 @©ħα® 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 Roberts, timr at probo.com
Providenza & Boekelheide, Inc.



More information about the python-win32 mailing list