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
posted on 2011-11-02 15:13  testerZH  阅读(193)  评论(0编辑  收藏  举报