Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 389
Default Automate Opening Files

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

B3 contents is: C:\My Documents\Export.xls C3 contents is: 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 in the BeforeDoubleClick of the Sheet:

----------------------------------------------

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 because I did a
'**Selection.copy on the password above but what I really
'**want is to have the password fill in automatic.

Macro1_Exit:
Exit Sub

Macro1_Err:
Resume Macro1_Exit

----------------------------------------------

Thank you for your help.

Steven
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 14
Default Automate Opening Files


Workbooks.Open Filename:=range("B3").value password:=range("C3").value

Cheers, Pete

"Steven" wrote:

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

B3 contents is: C:\My Documents\Export.xls C3 contents is: 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 in the BeforeDoubleClick of the Sheet:

----------------------------------------------

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 because I did a
'**Selection.copy on the password above but what I really
'**want is to have the password fill in automatic.

Macro1_Exit:
Exit Sub

Macro1_Err:
Resume Macro1_Exit

----------------------------------------------

Thank you for your help.

Steven

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
automate opening a .txt file James Excel Discussion (Misc queries) 3 July 1st 08 10:08 PM
Automate opening an add-in form janw Excel Discussion (Misc queries) 0 March 27th 08 04:42 PM
automate importing text files? sinnetBS Excel Discussion (Misc queries) 0 June 22nd 06 11:34 PM
Automate Hyperlinks to files Parisa Links and Linking in Excel 1 May 20th 06 03:50 PM
Automate response to protected files Rob Oldfield Excel Discussion (Misc queries) 2 October 14th 05 11:12 PM


All times are GMT +1. The time now is 12:17 AM.

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"