ajetrumpet
11-02-2009, 12:23 PM
hello all,
There is a problem I can't get my head around. I have this code for example:
Dim vPath As String
Dim vFTPServ As String
Dim fNum As Long
vPath = "C:"
vFTPServ = "domain.com"
fNum = FreeFile()
Open vPath & "\FtpComm.txt" For Output As #fNum
Print #1, "USER myUN" ' your login
Print #1, "pass" ' your password
Print #1, "dir " & Me.namefield & " c:\test.txt"
Print #1, "close"
Print #1, "quit"
Close
Shell "ftp -n -i -g -s:" & vPath & "\FtpComm.txt " & vFTPServ, vbHide
i am doing this everytime I want to view the contents of the TEST text file. my question is, is there a way that I can leave the FTP session open, and keep printing lines in the FTPCOMM file and keep executing DOS commands one at a time this way instead of opening and closing the connection each time?
I am getting a huge delay in updates when I run this procedure seperately evertime I want to update my interface with the DOS output, so if I can leave the session open I think I can completely eliminate the time I have to wait! I am using VBA with Office 2003 and windows vista. thanks all!
There is a problem I can't get my head around. I have this code for example:
Dim vPath As String
Dim vFTPServ As String
Dim fNum As Long
vPath = "C:"
vFTPServ = "domain.com"
fNum = FreeFile()
Open vPath & "\FtpComm.txt" For Output As #fNum
Print #1, "USER myUN" ' your login
Print #1, "pass" ' your password
Print #1, "dir " & Me.namefield & " c:\test.txt"
Print #1, "close"
Print #1, "quit"
Close
Shell "ftp -n -i -g -s:" & vPath & "\FtpComm.txt " & vFTPServ, vbHide
i am doing this everytime I want to view the contents of the TEST text file. my question is, is there a way that I can leave the FTP session open, and keep printing lines in the FTPCOMM file and keep executing DOS commands one at a time this way instead of opening and closing the connection each time?
I am getting a huge delay in updates when I run this procedure seperately evertime I want to update my interface with the DOS output, so if I can leave the session open I think I can completely eliminate the time I have to wait! I am using VBA with Office 2003 and windows vista. thanks all!