Dispatch("Excel.Application") failed

Mike Driscoll kyosohma at gmail.com
Thu Mar 13 14:03:49 CET 2008


On Mar 13, 1:02 am, lialie <lia... at gmail.com> wrote:
> Hi,
> Maybe it 's quite simple, but I can't fix it. Do I make some mistakes in
> my env setting? My excel version is 2003.
> any suggestion? Thanks.
>
> Traceback (most recent call last):
> File "testexcel.py", line 3, in ?
> excel = Dispatch("Excel.Application")
> File "C:\Python24\Lib\site-packages\win32com\client\__init__.py", line
> 95, in
> Dispatch
> dispatch, userName = dynamic._GetGoodDispatchAndUserName(dispatch,userName,c
> lsctx)
> File "C:\Python24\Lib\site-packages\win32com\client\dynamic.py", line
> 98, in _
> GetGoodDispatchAndUserName
> return (_GetGoodDispatch(IDispatch, clsctx), userName)
> File "C:\Python24\Lib\site-packages\win32com\client\dynamic.py", line
> 78, in _
> GetGoodDispatch
> IDispatch = pythoncom.CoCreateInstance(IDispatch, None, clsctx, pythoncom.II
> D_IDispatch)
> pywintypes.com_error: (-2147221005,
> '\xce\xde\xd0\xa7\xb5\xc4\xc0\xe0\xb1\xf0\xd7\xd6\xb7\xfb\xb4\xae',
> None, None)

I'm not seeing anything obviously wrong. What version of Windows are
you using? Are you logged in as an admin?

You also might try the PyWin32 user's mailing list:
http://mail.python.org/mailman/listinfo/python-win32

Mike



More information about the Python-list mailing list