title: Open a file on OneDrive using Excel VBA
body: <p>I have an Excel file (File #1) in which I would like the VBA code to open a file on my OneDrive (File #2).</p>
  
  <p>Many people will use File #1, so I want it to open File #2 in the background.</p>
  
  <p>I have created a shared link for File #2.  With this link anyone should be able to access the file.</p>
  
  <p>Link: <a href="https://1drv.ms/x/s!AmdCer05hKV4geAnbDaOSX9UrTfLHQ?e=5Pm7dL" rel="nofollow noreferrer">https://1drv.ms/x/s!AmdCer05hKV4geAnbDaOSX9UrTfLHQ?e=5Pm7dL</a></p>
  
  <p>How do I open this File #2 via VBA code in File #1?  <strong>I want it to open in Excel, not Excel on-line</strong>.</p>
  
  <p>I used this code. </p>
  
  <pre><code>Set wb = Workbooks.Open("https://1drv.ms/x/s!AmdCer05hKV4geAnbDaOSX9UrTfLHQ?e=5Pm7dL")
  </code></pre>
  
  <p>When this line of code runs, Excel shuts down and a window opens stating Microsoft Error Reporting.</p>
  
  <p>It then says</p>
  
  <blockquote>
    <p>"There was a problem with Microsoft Excel and we apologize for the inconvenience. Microsoft Excel will attempt to recover your work, but recent changes might be lost."</p>
  </blockquote>