title: External link new location VBA
body: <p>The below code works great for refreshing an external link in vba however is there a way of changing the location of the link?</p>
  
  <p>I can do this using linked table manager when ticking the 'Always prompt for new location', but I would like to do this via VBA, so that I could create a button for users to press to locate the new workbook</p>
  
  <p>Select new workbook, Relink external excel workbook.</p>
  
  <pre><code>Function Relink()
  
      Set db = CurrentDb
      Set tdf = db.TableDefs("Sales")
      tdf.Connect = "Excel 5.0;HDR=YES;IMEX=2;" &amp; _
      "DATABASE=C:\Sales.xlsb"
      tdf.RefreshLink
  
  End Function
  </code></pre>