Here is my solution. In all worksheets of the current workbook I simply replace a given string in the formula for a different one
Public Sub edit_links()
Dim iSheet As Worksheet
Dim old_text as string
Dim new_text as string
old_text = "='\\C\client\XYZ\[old_excel_file.xlsm]Sheet1'"
new_text = "=Sheet1"
For Each iSheet In ThisWorkbook.Sheets
'Debug.Print isheet.Name
Call update_all_cell_formulas_in_sheet( _
isheet, _
old_text, _
new_text)
Next iSheet
End Sub
private Sub update_all_cell_formulas_in_sheet(in_sheet As Worksheet, in_search As String, in_replace As String)
Dim counter As Integer
Dim iCell As Range
counter = 0
For Each iCell In in_sheet.UsedRange
If InStr(iCell.Formula, in_search) > 0 Then
counter = counter + 1
'Debug.Print iCell.Parent.Name, iCell.Address, iCell.Formula
iCell.Formula = Replace(iCell.Formula, in_search, in_replace)
'Debug.Assert counter Mod 100 <> 0 ' stop the code every 100 changes
End If
Next iCell
update_all_cell_formulas_in_sheet = counter
End Sub