win32com ChartObject pythonwin vs idle

Tim Golden mail at timgolden.me.uk
Thu Jul 31 04:28:32 EDT 2008


sterling wrote:
> I'm curious as to why the difference between IDLE and pythonWin when
> using win32com.
> opening an excel file, i've attempted to grab the chart information
> out of the file.
> 
> commands like co = ChartObjects(1)  works in pythonWin but doesn't
> work in IDLE.
> 
> however, on both co = chartobjects(1) works just fine.

I can't speak for IDLE vs PythonWin but in general
case-sensitivity of win32com stuff is related to
early vs late Dispatch. If you've explicitly generated
proxy modules for the Excel objects (via makepy,
EnsureDispatch or whatever) then those are Python
modules with case-sensitivity. If you're using dynamic
dispatch then Python is simply passing your attribute
name along to COM, which isn't case-sensitive, so either
case will work.

Not sure why IDLE vs PythonWin should make a difference
here, but maybe the above explanation sheds some light...

TJG



More information about the Python-list mailing list