Hello,

I'm trying to get values from a non-contiguous range, specifically
"E5:E10,E35"

Range("E5:E10,E35").Value -- only returns the values for "E5:E10", ignoring
"E35"
Range("E5:E10,E35").Address -- however returns "E5:E10,E35"
 Range("E5:E10,E35").Count -- returns 7, which is correct

I'm early-binding and using Python 2.6 and Pywin2.6.1

from win32com.client import Dispatch

    xl = Dispatch('Excel.Application')
    xl.Visible = 0
    xl.DisplayAlerts = 0
    xl.Workbooks.Open(xl_file)
    wrkbk = xl.ActiveWorkbook
    sht = wrkbk.Worksheets(1)
    print sht.Range("E5:E10,E35").Value
    print sht.Range("E5:E10,E35").Address
    wrkbk.Close()
    xl.Quit()

Any ideas? I've searched the complete archive and I've read Mark and Andy's
(excellent) book.
A VBA Macro works with this Range syntax.

Thank you,
JR
_______________________________________________
python-win32 mailing list
python-win32@python.org
http://mail.python.org/mailman/listinfo/python-win32

Reply via email to