I need urgently help with VBA and SharePoint.
I want to copy a file from SharePoint to a local folder. The script below is running on my PC. But I am a local admin. I figured out that on a “normal” PC with a “normal” user (no local admin) the script is not working. It stops at
If the user is going directly to the SharePoint there is no problem to copy the file.
Does anybody can help me?
Sub DownloadFromSharepoint_DB() Dim myURL As String Dim WinHttpReq As Object myURL = "sharepoint/link/test.accdb Set WinHttpReq = CreateObject("Microsoft.XMLHTTP") WinHttpReq.Open "GET", myURL, False WinHttpReq.Send If WinHttpReq.Status = 200 Then Set oStream = CreateObject("ADODB.Stream") oStream.Open oStream.Type = 1 oStream.Write WinHttpReq.ResponseBody oStream.SaveToFile ("C:\test\test.accdb"), 2 oStream.Close End If End Sub