E
Ed
I want to open an Excel file in 'read-only' with a password:
Dim db As DAO.Database
Dim rst As DAO.Recordset
Dim sfilename As String
'This works fine
sfilename = "noPassword.xls"
Set db = DBEngine.OpenDatabase(sfilename, _
False, True, "Excel 8.0")
'This does not work
sfilename = "hasPassword.xls"
Set db = DBEngine.OpenDatabase(sfilename, _
False, True, "Excel 8.0;PWD=123")
I get this error message:
Run time error 3161
Could not decrypt file
Dim db As DAO.Database
Dim rst As DAO.Recordset
Dim sfilename As String
'This works fine
sfilename = "noPassword.xls"
Set db = DBEngine.OpenDatabase(sfilename, _
False, True, "Excel 8.0")
'This does not work
sfilename = "hasPassword.xls"
Set db = DBEngine.OpenDatabase(sfilename, _
False, True, "Excel 8.0;PWD=123")
I get this error message:
Run time error 3161
Could not decrypt file