Accessing a COM object from Python

Hans Kristian Ruud hans.kristian.ruud at inenco.no
Thu Sep 28 06:12:01 EDT 2000


Hello.

I am currently experimenting with accessing COM-objects from
Python, as described in Mark Hammond and Andy Robinsons
book "Python programming on Win32" (great book).
Accessing Microsoft Excel (as described in the book) works fine, but
when I try our
Company's homegrown Com object, I get this error message:

>>> mikon = win32com.client.Dispatch("MikonChips.MiDataSource")
Traceback (innermost last):
  File "<interactive input>", line 1, in ?
  File "D:\program files\Python\win32com\client\__init__.py", line 13,
in Dispatch
    dispatch, userName =
dynamic._GetGoodDispatchAndUserName(dispatch,userName,clsctx)
  File "D:\program files\Python\win32com\client\dynamic.py", line 67, in
_GetGoodDispatchAndUserName
    return (_GetGoodDispatch(IDispatch, clsctx), userName)
  File "D:\program files\Python\win32com\client\dynamic.py", line 58, in
_GetGoodDispatch
    IDispatch = pythoncom.CoCreateInstance(IDispatch, None, clsctx,
pythoncom.IID_IDispatch)
com_error: (-2146959355, 'Server execution failed', None, None)
>>>

Any ideas???

Thanks in advance from the clueless one....

--
Hans Kristian Ruud
22 18 63 08 (jobb) 22 65 22 34 (hjemme) 952 33 224 (mob)
Wash daily from nosetip to tailtip, drink deeply but not to deep
remember the night is for hunting, forget not the day is for sleep





More information about the Python-list mailing list