HOLA!!!
Funcion (requiere un control Inet llamado Inet):
Private Function SubirFTP(ByVal URL As String , ByVal Usuario As String , ByVal Clave As String , ByVal RutaArchivoLocal As String , ByVal RutaArchivoRemoto As String) As Boolean
On Error Goto ErrSubirFTP:
With Inet1
.UserName = Usuario
.Password = Clave
.Execute URL, "PUT " & RutaArchivoLocal & " " & RutaArchivoRemoto
Do While .StillExecuting
DoEvents
Loop
SubirFTP= (.ResponseCode = 0)
End With
Exit Function
ErrSubirFTP:
SubirFTP = False
End Function
Para llamar a la Funcion:
UploadFile "ftp://tu.server.com", "Usuario", "Pass", "C:\ArchivoLocal.txt", "/Server/ArchivoRemoto.txt"
Para hacer un Debug del resultado de la subida:
Debug.Print UploadFile ("ftp://tu.server.com", "Usuario", "Pass", "C:\ArchivoLocal.txt", "/Server/ArchivoRemoto.txt")
Para hacer un Mensaje de texto del resultado de la subida:
MsgBox Iif(UploadFile ("ftp://tu.server.com", "Usuario", "Pass", "C:\ArchivoLocal.txt", "/Server/ArchivoRemoto.txt"), "Archivo Subido Correctamente", "Error - Archivo No Subido")
GRACIAS POR LEER!!!