Forum Discussion

Jackie Melendez's avatar
Jackie Melendez
Copper Contributor
Dec 14, 2017

VBA Macro to changesource to an external Link

I am not sure if this question has been asked here before. I have tried to look for similar threads but I am not able to find a clear answer. I have workbook that is linked to another workbook both currently reside on the same location, however, when the folder with the two workbooks are moved to another location the workbook with the links tries and finds the original source. Is there a way to keep the two workbooks associated with each other regardless the name of the workbook and location is changed?? I have thought to create a button in the workbook so that the end user can click and change the source themselves. Here is the code I have set up but need assistance on, my issue is I do not have the final location and name of the changed file. I am wondering if there is a way the user is able to select the location and name of the file themselves? Any suggestion would help at this point.

ActiveWorkbook.ChangeLink Name:= _
"Document 1_1.xlsm" _
, NewName:= _
"Document 2_1.xlsm" _
, Type:=xlExcelLinks
End Sub

No RepliesBe the first to reply

Resources