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

948 Steps to 6 Figures by Learning Excel-VBA and Other Skills



Step 534 - 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

   Table of Contents | Send us your feedback | © 2025 All Rights Reserved | Edit