方法1: MyXL.Workbooks.Open Filename:=strFileName, Password:=strPassword
方法2: Dim oExcel As Excel.Application Dim oBook As Excel.Workbook Set oExcel = New Excel.Application oExcel.Visible = True
Set oBook = oExcel.Workbooks.Open _ (FileName:="C:\Test\xxx.xls", _ ReadOnly:=True, _ Password:="secret")
Set oBook = Nothing Set oExcel = Nothing
|