如何用程序?qū)崿F(xiàn)鏈接有“打開密碼”的EXCEL表格

字號(hào):

方法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