View Single Post
  #15   Report Post  
Posted to microsoft.public.excel.misc
Dave Peterson Dave Peterson is offline
external usenet poster
 
Posts: 35,218
Default Linking to Password Protect Workbooks

I don't see why this line wouldn't work then:

Set wkbk = Workbooks.Open(Filename:=myFileNames(iCtr), _
Password:=myPasswords(iCtr))

Maybe you could add a line right before it:


msgbox ictr & vblf & myfilenames(ictr) & vblf & mypasswords(ictr)

Set wkbk = Workbooks.Open(Filename:=myFileNames(iCtr), _
Password:=myPasswords(iCtr))

Just to verify that you've got things matched up correctly.

(Yep, it's a shot in the dark!)

Paul Ferris wrote:

OK

This macro works perfectly

Sub aaaa()
Workbooks.Open Filename:="F:\Security\Logging\Aaron.xlsx", Password:="aar66"
End Sub

"Dave Peterson" wrote:

How about a test with smaller amount of workbooks and different passwords.

Create a new real workbook and two "sending" workbooks. And make the passwords
aaaa (or something easy).

Then test that.

Yep, I don't have a guess why it's not working for you. The code looks ok to
me.

In fact, how about just a single line test macro:

Option Explicit
sub aaaa()
workbooks.open filename:="F:\Security\Logging\Aaron.xlsx", password:="aar66"
Exit sub

I don't see why this would fail--except for typing mistakes.

Any chance that the password protected version of Aaron.xlsx isn't in
F:\security\logging. Maybe it's in a different folder??????


Paul Ferris wrote:

I open the helper workbook, and run the maco

It prompts me for the myRealWkbkName password and I enter that
It then opens the first protected workbook that it needs to read data from
for the "summary" book (in this case aaron.xlsx) and I am prompted for that
password)

The password is correct. If I do a copy and paste of the password from the
macro to workbook it opens, I just dont understand why then it is prompting
for the password

Sorry for being a newb

:)

Double checked the passwords - they are all correct


--

Dave Peterson


--

Dave Peterson