<div dir="ltr">Hi all!<br><br>I'm beginer in python-win32 and i try a simple example which is described in "Python for Win32 Extensions Help":<br><br>import win32com.client<br>o = win32com.client.Dispatch("<div dir="ltr">
Excel.Application")<br>
o.Visible = 1<br>o.Workbooks.Add() # for office 97 – 95 a bit different!<br>o.Cells(1,1).Value = "Hello"<br><br>But this example falls with traceback:<br><br> File "D:\Python25\pyprojects\pyexample\pyexample.py", line 6, in <module><br>
o.Workbooks.Add() # for office 97 – 95 a bit different!<br> File "D:\Python25\Lib\site-packages\win32com\client\dynamic.py", line 467, in __getattr__<br> if self._olerepr_.mapFuncs.has_key(attr): return self._make_method_(attr)<br>
File "D:\Python25\Lib\site-packages\win32com\client\dynamic.py", line 295, in _make_method_<br> methodCodeList = self._olerepr_.MakeFuncMethod(self._olerepr_.mapFuncs[name], methodName,0)<br> File "D:\Python25\Lib\site-packages\win32com\client\build.py", line 297, in MakeFuncMethod<br>
return self.MakeDispatchFuncMethod(entry, name, bMakeClass)<br> File "D:\Python25\Lib\site-packages\win32com\client\build.py", line 318, in MakeDispatchFuncMethod<br>
s = linePrefix + 'def ' + name + '(self' + BuildCallList(fdesc, names,
defNamedOptArg, defNamedNotOptArg, defUnnamedArg, defOutArg) + '):'<br>
File "D:\Python25\Lib\site-packages\win32com\client\build.py", line 604, in BuildCallList<br> argName = MakePublicAttributeName(argName)<br> File "D:\Python25\Lib\site-packages\win32com\client\build.py", line 542, in MakePublicAttributeName<br>
return filter( lambda char: char in valid_identifier_chars, className)<br> File "D:\Python25\Lib\site-packages\win32com\client\build.py", line 542, in <lambda><br> return filter( lambda char: char in valid_identifier_chars, className)<br>
UnicodeDecodeError: 'ascii' codec can't decode byte 0x80 in position 52: ordinal not in range(128)<br><br>Is
it bug or may be i should set some settings to make it works? I use
WinXP and MS Office 2003. Python-win32 has been intalled on my PC with
pywin32-211.win32-py2.5.exe installer.</div></div>