Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel Workbook Link Problem

Status
Not open for further replies.

vestax22

Programmer
Jun 18, 2003
139
0
0
CA
Hi, I have a workbook that gets data from another workbook. The linked cells contain full paths to the other workbook. These two workbooks will always be inside the same folder and this folder may be moved arround therefor breaking the links. I would like to link these workbooks more dynamically. Since they are always inside the same file is there a way to say something like current directory and the filename and then the range?

Hope this is clear
 
Hi,

You will have to do it with VBA like that:

Range("a1").Formula = "='" & CurDir & "\[NameFile.xls]Sheet1'!$A$1"


Jean-Paul
Montreal
To send me E-Mail, remove “USELESSCODE”.
jp@USELESSCODEsolutionsvba.com
 
If a file is moved via Explorer to a different folder, then the links will be broken between that file and file(s) in the original folder.

However, if you move ALL linked files from one folder to another, the links will be maintained between the files.

If ever there's is a need to "separate" files that are linked (i.e. into different folders), the links CAN be maintained... by first opening each file in Excel, and then saving the files to the different folder.

Hope this helps.

Regards, ...Dale Watson dwatson@bsi.gov.mb.ca
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top