Pythonwin and Office 2000

Paul Prescod paul at prescod.net
Sun Jun 27 17:52:07 CEST 1999


I believe that Pythonwin is not compatible with Office 2000. Here are some
symptoms:

D:\Program Files\PYTHON\WIN32COM\TEST>python testMSOffice.py

Starting Word 8 for dynamic test
Starting Word 8 for non-lazy dynamic test
Starting MSWord for generated test
Traceback (innermost last):
  File "testMSOffice.py", line 143, in TestAll
    TestWord()
  File "testMSOffice.py", line 46, in TestWord
    if gencache.EnsureModule("{00020905-0000-0000-C000-000000000046}",
1033, 8,
0) is None:
  File "D:\Program Files\Python\win32com\client\gencache.py", line 226, in
Ensur
eModule
    tlbAttr = pythoncom.LoadRegTypeLib(typelibCLSID, major, minor,
lcid).GetLibA
ttr()
com_error: (-2147319779, 'Library not registered.', None, None)


>>> a=win32com.client.Dispatch("MSWord.Application")
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: (-2147221005, 'Invalid class string', None, None)




  File "..\..\slides\slidesppvisitor.py", line 4, in ?
    ppmod = win32com.client.gencache.GetModuleForProgID(
"PowerPoint.Application" )
  File "D:\Program Files\Python\win32com\client\gencache.py", line 134, in
GetModuleForProgID
    return GetModuleForCLSID(iid)
  File "D:\Program Files\Python\win32com\client\gencache.py", line 152, in
GetModuleForCLSID
    return GetModuleForTypelib(typelibCLSID, lcid, major, minor)
  File "D:\Program Files\Python\win32com\client\gencache.py", line 167, in
GetModuleForTypelib
    return _GetModule(modName)
  File "D:\Program Files\Python\win32com\client\gencache.py", line 328, in
_GetModule
    mod = __import__("win32com.gen_py.%s" % fname)
  File "D:\Program
Files\Python\win32com\gen_py\91493440-5A91-11CF-8700-00AA0060263Bx0x2x14.py",
line 4549
    def AddOLEObject(self, Left=0.0, Top=0.0, Width=-1.0, Height=-1.0,
ClassName
=L'', FileName=L'', DisplayAsIcon=0, IconFileName=L'', IconIndex=0,
IconLabel=L'
', Link=0):

Is this "L" syntax a future syntax for Unicode that Python 1.5.2 doesn't
support? Perhaps PythonWin should test for support for that syntax before
it generates the Python code?

-- 
 Paul Prescod  - ISOGEN Consulting Engineer speaking for only himself
 http://itrc.uwaterloo.ca/~papresco

Perhaps the war in Kosovo would get more press if it were directed by
George Lucas.




More information about the Python-list mailing list