Are you just downloading and renaming the file?
If you are then perhaps you could use the Windows API function URLDownloadFile.
For example,
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
Function DownloadFileFromWeb(strURL As String, strSaveName As String, strSavePath As String) As Boolean
Dim returnValue As Long
returnValue = URLDownloadToFile(0, strURL, strSavePath & strSaveName, 0, 0)
DownloadFileFromWeb = returnValue = 0
End Function
which you could use like this.
Dim FileDownloadSuccesful As Boolean
Dim Response As VbMsgBoxResult
Dim strFilePath As String
Dim strFileName As String
Do
FileDownloadSuccesful = DownloadFileFromWeb(strFilePath & strFileName, strFileName, CreateObject("Wscript.shell").specialfolders("Desktop") & "\Source Data\")
If Not FileDownloadSuccesful Then
Response = MsgBox("Download unsuccesful, do you want to try again?", vbYesNo, "Download failed")
If Response = vbNo Then Exit Sub
End If
Loop Until FileDownloadSuccesful
Bookmarks