Hi all,
Below is the code I am using to download a file from an FTP server. When "Set FTP = New Inet" is executed I get error:
runtime error 429
ActiveX component can't create object
(p.s. I checked hte Microsoft Internet Transfer Control 6.0 (SP6) in the references, after installing msinet in SysWOW64, and registering in the cmd.exe by typing "regsvr32 msinet.ocx". I got a confirmatin that the file was registered, and can see it in the references.)
Can someone please advise why I am getting this error.
thank you kindly
Ron
Function DownloadFile(ByVal HostName As String, _
ByVal UserName As String, _
ByVal Password As String, _
ByVal RemoteFileName As String, _
ByVal LocalFileName As String) As Boolean
Dim FTP As Inet
Set FTP = New Inet
With FTP
.Protocol = icFTP
.RemoteHost = HostName
.UserName = UserName
.Password = Password
.Execute .URL, "Get " + RemoteFileName + " " + LocalFileName
Do While .StillExecuting
DoEvents
Loop
DownloadFile = (.ResponseCode = 0)
End With
Set FTP = Nothing
End Function
Below is the code I am using to download a file from an FTP server. When "Set FTP = New Inet" is executed I get error:
runtime error 429
ActiveX component can't create object
(p.s. I checked hte Microsoft Internet Transfer Control 6.0 (SP6) in the references, after installing msinet in SysWOW64, and registering in the cmd.exe by typing "regsvr32 msinet.ocx". I got a confirmatin that the file was registered, and can see it in the references.)
Can someone please advise why I am getting this error.
thank you kindly
Ron
Function DownloadFile(ByVal HostName As String, _
ByVal UserName As String, _
ByVal Password As String, _
ByVal RemoteFileName As String, _
ByVal LocalFileName As String) As Boolean
Dim FTP As Inet
Set FTP = New Inet
With FTP
.Protocol = icFTP
.RemoteHost = HostName
.UserName = UserName
.Password = Password
.Execute .URL, "Get " + RemoteFileName + " " + LocalFileName
Do While .StillExecuting
DoEvents
Loop
DownloadFile = (.ResponseCode = 0)
End With
Set FTP = Nothing
End Function