By using expertatexcel.com you agree to our cookie policy, We and our partners operate globally and use cookies, for multiple purposes

Become an Σxpert at Σxcel.com

 


DownLoadFileFromWeb(to,from) - udf

#if Win64 Then
Private Declare PtrSafe Function URLDownloadTofile Lib "urlmon" Alias "URLDownloadTofileA" (ByVal pCaller As Long, _
   ByVal szURL As String, ByVal szFileName As String, ByVal dwReserved As Long, ByVal lpfnCB As Long) As Long
#Else
Private Declare Function URLDownloadTofile Lib "urlmon" Alias "URLDownloadTofileA" (ByVal pCaller As Long, _
   ByVal szURL As String, ByVal szFileName As String, ByVal dwReserved As Long, ByVal lpfnCB As Long) As Long
#End If


Function DownloadFileFromWeb(strURL As String, strSavePath As String) As Long
On Error Resume Next

DownloadFileFromWeb = URLDownLoadToFile(0, strURL, strSavePath, 0, 0)
End Function