Strange discrepancy between Excel VBA and Python

Moore, Paul Paul.Moore at
Wed Mar 12 14:36:51 CET 2003

When I try to resize a range in Python, I get a different answer from VBA.

Simple example, get a block of 10 cells at the top left of sheet 1 (I know
I can do this other ways, but it illustrates the point)

>From the Excel VBA immediate window:

? Sheets(1).Cells(1,1).Resize(10,10).Address

>From PythonWin:

>>> xl = Dispatch("Excel.Application")
>>> xl
<win32com.gen_py.Microsoft Excel 9.0 Object Library._Application instance at 0x72000536>
>>> xl.Sheets(1).Cells(1,1).Resize(10,10).Address

(You note that I have run Makepy).

Why is Python showing this as a single cell???

Thanks for any help, I really hate the Excel object model :-(


More information about the Python-list mailing list