vbs,如xls的密码为123456,那么- Set fso = CreateObject("Scripting.FileSystemObject")
- Set oExcel= CreateObject("Excel.Application")
- Set oWBook = oExcel.Workbooks.Open(fso.GetFolder(".").Path & "\test.xls",,,,"123456")
- '读取Sheet1表A1单元格的内容
- Set oSheet = oWBook.Sheets("Sheet1")
- Wscript.echo oSheet.Range("A1").Value
- oWBook.Close
- oExcel.Quit
复制代码
|