Discretely open workbook with password?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello,

I'm using Excel/Access 2003. I have an Access form that will transfer Excel
spreadsheets into Access using TransferSpreadsheet. The Excel spreadsheet I
need to import is password protected, and I have the password.
Does anyone know what the code would look like that would open the workbook,
using the password I already have, so that I can successfully transfer the
spreadsheet into Access without any sort of manual prompt for a password?

I have tried simply transfering a protected workbook and it's not taking.
So I'm assuming I must first open the workbook before I can transfer.

Suggestions are welcome!

Thanks,

-Scott
 
While password to modify is not set, this works for me:
Sub Openpwddbook()
Workbooks.Open Filename:="e:\book5.xls", Password:="123"
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top