I have an Excel file (File #1) in which I would like the VBA code to open a file on my OneDrive (File #2).
Many people will use File #1, so I want it to open File #2 in the background.
I have created a shared link for File #2. With this link anyone should be able to access the file.
Link: https://1drv.ms/x/s!AmdCer05hKV4geAnbDaOSX9UrTfLHQ?e=5Pm7dL
How do I open this File #2 via VBA code in File #1? I want it to open in Excel, not Excel on-line.
I used this code.
Set wb = Workbooks.Open("https://1drv.ms/x/s!AmdCer05hKV4geAnbDaOSX9UrTfLHQ?e=5Pm7dL")
When this line of code runs, Excel shuts down and a window opens stating Microsoft Error Reporting.
It then says
"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."