Function DownloadFileFromWeb(sURL as String, sPath as String)
On Error Resume Next
DownloadFileFromWeb = URLDownloadToFile(0, sURL, sPath, 0, 0)
End Function
In the (Declarations) section of a module add
Private Declare Function URLDownloadToFile Lib "urlmon" Alias "URLDownloadToFileA" (ByVal pCaller As Long, _
ByVal scURL As String, ByVal szFileName As String, ByVal dwReserved As Long, ByVal lpfnCB As Long) As Long
and the whole calling sequence
sFile = Range("DQ_File") ' note range name in spreadsheet with http://Sharepoint3.company.com/..../xyz.
s = Now()
sZipFile = "H:\test & format(s, "yyyy-mm-dd") & ".zip"
On Error Resume Next
Kill sZipFile
x = DownloadFileFromWeb(sFile, (sZipfile))
if x <> 0 then
MsgBox x & " " & Error(x) & " while downloading " & sZipFile
Stop
End if