Accessing Excel Data with Password 
Author Message
 Accessing Excel Data with Password

I'm trying to read a data table in VB4 (16 Bit) from an Excel 95 file saved
with a protection password. Whenever I try to access the protected file
with the code below, I get the error 3161: Couldn't Decrypt File.  This
works fine with the Excel File unprotected.  Here's the code:

Public Sub GetDatabase()
Dim ws1 As Workspace, db1 As Database
Set ws1 = DBEngine.CreateWorkspace("data", "Admin", "")
Set db1 = ws1.OpenDatabase("c:\data.xls", False, True, "Excel
5.0;PWD=test")
End Sub

When I save data.xls without a password and use the following line,
everything is fine:
Set db1 = ws1.OpenDatabase("c:\data.xls", False, True, "Excel 5.0")

Any ideas?



Sat, 05 Feb 2000 03:00:00 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. password protected Access data base with Data Control

2. VB4: How to let a Data control access a password protected ACCESS database

3. how do i access a password protected MS-ACCESS db without the password

4. Passing a password from Access to Excel

5. How to link a password protected Excel 97 Spreadsheet to Access 97

6. Opening an Access database with a password in Excel

7. Accessing Password Protected Excel Spreadsheets

8. Trouble accessing access dbase data from excel.

9. Access Password in Data Control properties

10. ADO Data Control and Access password - VERY URGENT

11. Using MS Data Control DAO to access a password protected database

12. using data control on password protected access db

 

 
Powered by phpBB® Forum Software