Hi Atul,
Please find attached sample files with excel VBA code to replace all Old links with New link in formulas. Extract all the files in a folder and Open "Master Workbook.xlsm" file to run ReplaceLinks Macro.
Code Procedure:
Sub ReplaceLinks()
Dim Link As Variant
Dim NewWorkBook As String
Dim strNewWorkBook As String
' Run the Input Box method to collect New Workbook path
strNewWorkBook = Application.InputBox("Please Enter new workbook path.", _
"New WorkBook", , , , "", , 2)
' Check to see if Input Box is empty. If Yes, procedure will end
If strNewWorkBook <> "" Then
For Each Link In ActiveWorkbook.LinkSources
'Replacing old links
ActiveWorkbook.ChangeLink Name:=Link, NewName:=strNewWorkBook, Type:=xlExcelLinks
Next Link
End If
MsgBox "All Links have been replaced!", vbInformation, "Completed"
End Sub
Note: while running VBA procedure, in the message box input new file name as “C:\Users\Mahesh\Desktop\New workbook.xlsx” (Please replace given folder path with your folder path)
Let me know if you have any question or need any further help in this regard.
Thanks,
Mahesh