Home / Software / Computer programming / VBA programming with FTP sessions
0 Members and 1 Guest are viewing this topic. « previous next »
Pages: [1] - (Bottom) Print
Author Topic: VBA programming with FTP sessions  (Read 534 times)
ajetrumpet
Topic Starter
Rookie



Posts: 18


« on: November 02, 2009, 12:03:53 PM »

hello all,

There is a problem I can't get my head around. I have this code for example:
Code: [Select]
      Dim vPath As String
      Dim vFTPServ As String
      Dim fNum As Long
     
      vPath = "C:"
      vFTPServ = "www.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!
IP logged
gh0std0g74
Apprentice



Thanked: 37
Posts: 590


« Reply #1 on: November 02, 2009, 05:08:35 PM »

do you absolutely have to do this with VBA? you are using the wrong choice of tools to do FTP.
IP logged

ajetrumpet
Topic Starter
Rookie



Posts: 18


« Reply #2 on: November 02, 2009, 06:53:21 PM »

i do need to do it in VBA, yes.  I searched for the INET active X, but apparently you have to pay to get it downloaded.  is that true?
IP logged
gh0std0g74
Apprentice



Thanked: 37
Posts: 590


« Reply #3 on: November 02, 2009, 07:11:28 PM »

i do need to do it in VBA, yes.  I searched for the INET active X, but apparently you have to pay to get it downloaded.  is that true?
I am not sure because I don't have to pay to do programming. If you are being forced to pay to program, then you are being ripped off. A lot of stuff to do programming are free. Perl/Python etc comes with excellent FTP libraries that makes your file transfer job easier. If you can find a library that you can use with VBA that is free, go ahead and use it.
IP logged

Pages: [1] - (Top) Print 
Home / Software / Computer programming / VBA programming with FTP sessions « previous next »
 


Login with username, password and session length

Old Forum Search | Forum Rules
Copyright © 2010 Computer Hope ® All rights reserved.
Powered by SMF 2.0 RC3 | SMF © 2006–2010, Simple Machines LLC
Page created in 0.081 seconds with 21 queries.