The following code is not working in excel 2003 where as It's working fine in excel 2007.
I guess there is a compatibility issue. how to change this to work fine in excel 2003 version.
Option Explicit
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
Sub DownloadFileFromWeb()
Dim i As Integer
Const strUrl As String = "https://myportal.com/ZZDR6.csv"
Dim strSavePath As String
Dim returnValue As Long
strSavePath = "\\filesrv01\dsdf\SE\EERDV_1.csv"
returnValue = URLDownloadToFile(0, strUrl, strSavePath, 0, 0)
End Sub
Bookmarks