Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
ed ed is offline
external usenet poster
 
Posts: 59
Default help to open pwd Excel from Access

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
--
Ed


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 593
Default help to open pwd Excel from Access

"Ed" wrote ...

I want to open an Excel file in 'read-only' with a password:

I get this error message:
Run time error 3161
Could not decrypt file


As the error message suggests, adding a password encrypts the workbook
on disk. The Excel UI is require to decrypt. See:

Microsoft Knowledge Base Article - 211378
XL2000: "Could Not Decrypt File" Error with Password Protected File
http://support.microsoft.com/?KBID=211378

Jamie.

--
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
open access from excel ? יריב החביב Excel Discussion (Misc queries) 2 July 21st 08 01:49 PM
EXCEL TRIES TO OPEN IN ACCESS cfarns Excel Discussion (Misc queries) 2 September 20th 07 01:50 AM
Excel cannot open Access MDB Neva Excel Discussion (Misc queries) 0 April 4th 05 08:35 PM
Open Access db from Excel Will[_7_] Excel Programming 0 May 13th 04 09:32 PM
Open Excel from access John[_46_] Excel Programming 4 September 8th 03 05:44 PM


All times are GMT +1. The time now is 05:05 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"