Linked File and Range

  • Thread starter Thread starter Troubled User
  • Start date Start date
T

Troubled User

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
 
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.
 

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

Back
Top