Automated file opening

G

Guest

I have a master excel file with a column for file names and in the next
column the password. For example:

B C

3 C:\My Documents\Export.xls pwtest

I put a macro in the code of the sheet so when I double click on B3 it opens
the file to where you input the password. Is there a way to automatically
fill in the password with the contrents of C3?

So far I have been doing like this:

Sub zOpenFile()

On Error GoTo Macro1_Err

vOpen = ActiveCell.Value

ActiveCell.Offset(0, 1).Range("A1:A1").Select
If IsEmpty(ActiveCell.Value) Then
Else
Selection.Copy
End If
ActiveCell.Offset(0, -1).Range("A1:A1").Select
Workbooks.Open Filename:=vOpen

'**Note: I am stuck here. I can hit Ctrl-V but I what I really
'**want is to have the password fill in automatic.

Macro1_Exit:
Exit Sub

Macro1_Err:
Resume Macro1_Exit

End Sub

Thank you for your help.

Steven
 
G

Guest

Note from Steven: for clarification:

B3 contents is: C:\My Documents\Export.xls C3 contents is: pwtest
 
G

Guest

You are in an Access news group. I think it would be better if you posted
your question in an Excel news group. Just a tip, however:
When I have to do some Excel VBA and I am unsure of how to code it. I start
recording a new macro, do what I want the code to do, save the macro, then
copy the code into my module.
 

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

Top