Dim ExcelBook,ExcelSheel,myExcelBook,myExcelSheet
filePath="E:\case.xls"
Set fso = CreateObject ("Scripting.FileSystemObject")
Set ExcelBook = CreateObject("Excel.Application")
Set ExcelSheel = CreateObject("Excel.Sheet")
Dim ExcelBook,ExcelSheel,myExcelBook,myExcelSheet
filePath="E:\case.xls"
Set fso = CreateObject ("Scripting.FileSystemObject") 创建FSO对象
Set ExcelBook = CreateObject("Excel.Application") 创建Excel对象
Set ExcelSheel = CreateObject("Excel.Sheet") 创建Excel的sheet对象
Set myExcelBook = ExcelBook.Workbooks.Open(filePath) 打开对应路径的excel文件,并获得这个excel对象
Set myExcelSheet = myExcelBook.Worksheets("Sheet1") 得到excel的sheet1的对象,也就是第一个工作簿。