I have a procedure that will list all the external links in the workbook, and then updated the links to point to different files using the following:
ThisWorkbook.ChangeLink Name:=sStr, NewName:=sFullPath, Type:=xlExcelLinks
ThisWorkbook.UpdateLink Name:=sFullPath, Type:=xlExcelLinks
This seems to work absolutely fine and as expected in the majority of cases however I have come across an unusual case where for some reason this code also inserts the new file paths into the 'RefersTo' section of a dynamic named range (uses offset)
The named range refersto value before running the code will be:
=OFFSET('Link Info'!$A$2,0,0,COUNTA('Link Info'!$A$2:$A$65000),2)
and afterwards it is:
=OFFSET('T:\My Documents\[Price Load.xls]Overview'!$A$2,0,0,COUNTA('T:\My Documents\[Price Load.xls]Overview'!$A$2:$A$65000),2)
Am I doing something stupidly wrong?
Is this expected?
or is this an Excel quirky bug?
Thanks in advance
Bookmarks