Set ExcelApp=CreateObject("Excel.Application")
Set ExcelWorkbook=ExcelApp.Workbooks.Open(FilePath)
Set ExcelSheet=ExcelWor.Worksheets(SheetName).UsedRange
rowcount=ExcelSheet.Rows.count ‘计算使用的单元格行数
columncount=ExcelSheet.Columns.count ‘计算使用的单元格的列数
For i=1 to rowcount
For j=1 to columncount
Msgbox ExcelSheet.Cells(i,j)
Next
Next
Set ExcelSheet=Nothing
ExcelWorkbook.Close
ExcelApp.Quit
转载于:https://www.cnblogs.com/testerZH/archive/2011/11/02/2233103.html