I am trying to use the minet.ocx to automatically download a file on a FTP
site. I downloaded the code snippet from the MVPS.org website and set it all
up. I must be doing something wrong, since the file never transfers but I
don't get an error message! I can manually drag and drop the file so I know
I have access to the FTP site.
Below is the code. Any help is appreciated.
^^^^^^^^^^^^^^^^START CODE
Sub FTPCheck()
Const cHost = "www.leg.state.nv.us"
Const cUserName = ""
Const cPW = ""
Dim strData As String
Dim strTempFile As String
strData = "Test Document.doc"
strTempFile = "C:\" & strData
MsgBox DownloadFile(cHost, cUserName, cPW, strData, strTempFile)
End Sub
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
^^^^^^^^^^^^^^^^^^^^^^^^ END CODE
TIA and have a great day!
Steve
I figured out the problem. The web dudes gave me the wrong FTP address. No
problems, once it is the correct place to go!
Steve
"Steve Lang" <now...@Nohow.not> wrote in message
news:uoMGpfYd...@tk2msftngp13.phx.gbl...
Set FTP = New Inet
The error is "429: ActiveX cannot create object"
I have the references loaded on the user's computer, and I copied and
registered the msinet.ocx as well. Anyone have any ideas as to what to look
for now?
TIA and have a great day!
Steve
"Steve Lang" <now...@Nohow.not> wrote in message
news:OBMXjQZd...@tk2msftngp13.phx.gbl...