win32com /makepy
Thomas Heller
thomas.heller at ion-tof.com
Fri Oct 18 16:01:20 EDT 2002
Paul.Casteels at ua.ac.be writes:
> This simple program works, but is slow when I start adding arrays :
>
> from win32com.client import Dispatch
> xlApp = Dispatch("Excel.Application")
> xlApp.Workbooks.Add()
> xlApp.ActiveWorkBook.SaveAs('tutu')
> xlApp.Quit()
> del xlApp
>
> After I run makepy, to speed it up, (Excel 9.0 Object Library), this program
> produces :
>
> Traceback (most recent call last):
> File "C:\DOCUME~1\paul\MYDOCU~1\Python\Cvt\testExcel.py", line 6, in ?
> xlApp.ActiveWorkBook.SaveAs(Filename = 'tutu')
> File "C:\Python22\Lib\site-packages\win32com\client\__init__.py", line
> 346, in __getattr__
> raise AttributeError, attr
> AttributeError: ActiveWorkBook
>
> Why is ActiveWorkBook no longer available ?
> I had this with ActivePython 2.2.0, I have updated to 2.2.1 but the
> resut is the same.
Isn't all this case-sensitive after running makepy?
You could also look into the generated file for ActiveWorkBook...
HTH,
Thomas
More information about the Python-list
mailing list