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
---------------------------------------------------------------
AUTHOR:testerZH
用途:菜鸟的个人学习记录,有不对的地方请指正!谢谢!
出处:http://www.cnblogs.com/testerZH/