0

I'm trying to open and manipulate a SharePoint Excel file but am having trouble referencing it correctly in the first place.

I've used the simple code below. Firstly, I've taken the second solution from here to convert a shareable SharePoint link into a WebDAV link, then inserted this below.

I receive a run-time error 1004, "Application-defined or object-defined error". The original sharing link I have works correctly in a browser. The WebDAV link doesn't work in a browser or in Windows Explorer, even reducing it to just access the folder, rather than the file itself....

Does anyone have any ideas what could be causing this/other ways to achieve the same goal?

Thanks!

Note: The link below is a dummy link just to show syntax

Sub OpenSharepointSharingLink2()

Dim wb As Workbook

'Open Excel File.
Set wb = Workbooks.Open("\\company.sharepoint.com@ssl\:x:\s\Folder\CBaAYOw2mKBDoiFTT3680dUBUHl6F2aGa9Cw_dHNaB4zwQ?e=zQeEEQ")


End Sub
Martijn Pieters
  • 1,048,767
  • 296
  • 4,058
  • 3,343

1 Answers1

0

Right click on the sharpoint folder and and then properties. Then don’t click anywhere else. The path will show up in the window that will pop up. Just copy it. When working with link folders you have to copy the path from the properties, it’s different