title: Excel VBA macro - Change link name
body: <p>I have a excel macro routine that I need to prep a file for another routine which is run daily. This prepping involves changes the links of t-1 file to a t0 file. </p>
  
  <p>The code I usually do is:</p>
  
  <pre><code>ActiveWorkbook.ChangeLink Name:= _
          "file path", NewName:=new_file_path, Type:=xlExcelLinks
  </code></pre>
  
  <p>My trouble now is that for this particular routine the file path to be changed to a new routine is not always the same, thus I would need a way to automatize finding out what are the current links to replace them all. The new file path I now because it is the worksheet that is calling this routine and opening this file, so first thing I do Is</p>
  
  <pre><code>new_file_path = "C:\...."&amp; ActiveWorkbook.Name &amp; ".xlsm"
  </code></pre>
  
  <p>What would help me is if there is a trick to replace all links for a new one, without the need to say the name/path of the old links. Does any one know? </p>
  
  <p>Thanks</p>