Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I need to be able to set up a Linked File that is referenced in 500 linked
locations in the Primary File and then be able to change the Linked File (by a macro asking the user to select a new file location) to reference a new source Linked File location, store the value from the source location and then update all of the links. Any help would be appreciated. I was looking at getting the file path using the following and then building each of the links manually, but the syntax is not correct: 'Get the File Path Dim TargetFileName As String TargetFileName = Application.GetOpenFilename ShtMacro.Range("RngFilePath").Value = TargetFileName 'Reset the Links Dim ExistingFileName As String Dim NewFileName As String Cells.Replace What:=ExistingFileName, Replacement:=NewFileName, LookAt:= _ xlPart, SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _ ReplaceFormat:=False |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
You could use .getopenfilename to find the new workbook, but why not use
Edit|Links (record a macro to get that syntax) to change the links. Troubled User wrote: I need to be able to set up a Linked File that is referenced in 500 linked locations in the Primary File and then be able to change the Linked File (by a macro asking the user to select a new file location) to reference a new source Linked File location, store the value from the source location and then update all of the links. Any help would be appreciated. I was looking at getting the file path using the following and then building each of the links manually, but the syntax is not correct: 'Get the File Path Dim TargetFileName As String TargetFileName = Application.GetOpenFilename ShtMacro.Range("RngFilePath").Value = TargetFileName 'Reset the Links Dim ExistingFileName As String Dim NewFileName As String Cells.Replace What:=ExistingFileName, Replacement:=NewFileName, LookAt:= _ xlPart, SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _ ReplaceFormat:=False -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Linked spreadsheets failing to recognised that the linked file is | Excel Discussion (Misc queries) | |||
Displaying linked data in excel 2007 when linked file is not avail | Excel Discussion (Misc queries) | |||
Linked File Calcuation req. source file to be open | Excel Discussion (Misc queries) | |||
In a linked calculation how do I lose the '0' in the linked file? | Excel Worksheet Functions | |||
ListFillRange linked to named range in a closed remote file | Excel Programming |