Hi,
I am new to excel VBA. I am trying to FTP a text file to a server. I am using the below code to achieve it.
Code :
vPath = "c:\Documents and Settings\Mike Gend"
VFTP = "fpsba.com"
num = FreeFile()
Open Vpath & "\ftpcommands.txt" For Output as #num
Print #1, "User Mike"
Print #1, "XXXXX"
Print #1, "cd Mike"
Print #1, "put delta.txt"
Print #1, "close"
Print #1, "quit"
close #num
shell "ftp -n -i -g -s:" & vPath &\ftpcommands.txt" & VFTP,vbNormalNoFOcus
Here are what I am exactly lookin for :
1. Normally I will get connection errors. I am not sure how to handle connection errors using VBA. Is it possible to perform retry logic automatically?
2. I am not sure how to find whether the file transfer is successful or not
Any help is appreciated!
Thanks
Mike
I am new to excel VBA. I am trying to FTP a text file to a server. I am using the below code to achieve it.
Code :
vPath = "c:\Documents and Settings\Mike Gend"
VFTP = "fpsba.com"
num = FreeFile()
Open Vpath & "\ftpcommands.txt" For Output as #num
Print #1, "User Mike"
Print #1, "XXXXX"
Print #1, "cd Mike"
Print #1, "put delta.txt"
Print #1, "close"
Print #1, "quit"
close #num
shell "ftp -n -i -g -s:" & vPath &\ftpcommands.txt" & VFTP,vbNormalNoFOcus
Here are what I am exactly lookin for :
1. Normally I will get connection errors. I am not sure how to handle connection errors using VBA. Is it possible to perform retry logic automatically?
2. I am not sure how to find whether the file transfer is successful or not
Any help is appreciated!
Thanks
Mike