Objekterstellung durch ActiveX nicht möglich
28.04.2005 12:20:27
Ron
ich habe folgenden Code um einen Datei per FTP in das Internet upzuloaden. Leider funktioniert das nicht. Ich bekomm die Fehlermeldung: Objeterstellung durch ActiveX Komponente nicht möglich. Der Verweis auf die Datei ist aber gesetzt! Kann jemand helfen?
Function UploadFile(ByVal HostName As String, _
ByVal UserName As String, _
ByVal Password As String, _
ByVal LocalFileName As String, _
ByVal RemoteFileName As String) As Boolean
Dim FTP As New Inet
'Verweis zu MS Internet Transfer Control Dateiname:
c:windows\system32\msinet.ocx
With FTP
.Protocol = icFTP
.RemoteHost = HostName
.UserName = UserName
.Password = Password
.Execute .URL, "Put " + LocalFileName + " " + RemoteFileName
Do While .StillExecuting
DoEvents
Loop
UploadFile = (.ResponseCode = 0)
End With
Set FTP = Nothing
End Function
Gruß Ron