How to modify a reference model file of a drawing file with a solidworks macro program
Use ReplaceReferencedDocument method but make sure that all files are closed.
You can also look at using ReplaceReference method
Thank you Deepak Gupta
In addition to Deepak's answer, here is an example of the same in Document Manager (second method mentioned by Deepak):
Replace references in components or drawing views using SOLIDWORKS Document Manager API
Thank you Artem Taturevych
Retrieving data ...