Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 85
Default Linked File and Range

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Linked File and Range

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
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
Linked spreadsheets failing to recognised that the linked file is Michael Excel Discussion (Misc queries) 0 January 14th 10 12:03 PM
Displaying linked data in excel 2007 when linked file is not avail Eng_19 Excel Discussion (Misc queries) 0 December 7th 07 07:27 PM
Linked File Calcuation req. source file to be open smcd Excel Discussion (Misc queries) 1 April 19th 06 03:09 AM
In a linked calculation how do I lose the '0' in the linked file? Anita Excel Worksheet Functions 2 February 3rd 06 01:54 PM
ListFillRange linked to named range in a closed remote file Chuck Hyre Excel Programming 0 April 14th 05 09:42 PM


All times are GMT +1. The time now is 03:03 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"