代码如下
Set ExcelApp = createobject("Excel.Application")
Set ExcelWor=ExcelApp.Workbooks.Open("E:\QTP_SAVE\EOM\Eom.xls")
Set ExcelShe = ExcelWor.Worksheets("sheets").UsedRange
rowcount = ExcelShe.Rows.count
columncount = ExcelShe.Columns.count
For i=1 to rowcount
For j=1 to columncount
msgbox ExcelShe.cells(i,j)
Next
Next