'VBA, get sharepoint list?
I currently have this to download a file from SharePoint, and it is working,
Dim WinHttpReq As Object
Dim oStream As Object
myURL = "https://sharepoint..../my_folder/" & "File_I_want.PDF"
download_location = "C:\Users\username\Downloads\"
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 download_location & "File_I_want.PDF", 2
oStream.Close
End If
However the "File_I_Want" isn't always named the same, so trying to create a loop that first loops through all the files in,
myURL = "https://sharepoint..../my_folder/"
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
