COM traceback translation

dsavitsk dsavitsk at e-coli.net
Mon Mar 11 15:31:50 EST 2002


can anybody help with this one? there is a module called test_write.  when
it is imported from a python prompt and generate_doc() is called it works
fine.  When it is invoked by a COM object it throws this error.

thanks,

doug



Traceback (most recent call last):
  File "X:\epsp2\server\bin\test_write.py", line 5, in generate_doc
    wordApp = win32com.client.Dispatch('Word.Application')
  File "C:\Python\win32com\client\__init__.py", line 94, in Dispatch
    dispatch, userName =
dynamic._GetGoodDispatchAndUserName(dispatch,userName,clsctx)
  File "C:\Python\win32com\client\dynamic.py", line 81, in
_GetGoodDispatchAndUserName
    return (_GetGoodDispatch(IDispatch, clsctx), userName)
  File "C:\Python\win32com\client\dynamic.py", line 72, in _GetGoodDispatch
    IDispatch = pythoncom.CoCreateInstance(IDispatch, None, clsctx,
pythoncom.IID_IDispatch)
pywintypes.com_error: (-2147221008, 'CoInitialize has not been called.',
None, None)





More information about the Python-list mailing list