【发布时间】:2016-03-26 07:41:44
【问题描述】:
我想找到 Excel 工作表范围内的左上角单元格和右下角单元格,这是工作表中所有占用单元格的边界框,来自 win 7 上的 ironpython 2.7.5。
我的代码:
from Microsoft.Office.Interop import Excel
from System import Type
excel = Excel.ApplicationClass()
workbook = excel.Workbooks.Open(excelFilename, False, True)
allWorksheets = workbook.WorkSheets
for aWorkSheet in allWorksheets:
last = aWs.Cells.SpecialCells(Excel.XlCellType.xlCellTypeLastCell, Type.Missing);
range = excel.get_Range("A1", last);
print "a worksheet range is " + str(range)
我需要在“范围”中找到左上角单元格和右下角单元格
处的链接Programmatically getting the last filled excel row using C#
How to get the range of occupied cells in excel sheet
帮不了我。
有什么建议吗?谢谢
【问题讨论】:
标签: excel python-2.7 ironpython worksheet