help - excel vba and FTP/batch files

Discussion in 'OT Technology' started by GuOD, Mar 7, 2008.

  1. GuOD

    GuOD mcflurry diet

    Joined:
    May 19, 2003
    Messages:
    7,366
    Likes Received:
    0
    Location:
    Toronto
    Hi guys,

    So I wrote a macro to make a batch file with instructions for FTP files.

    Two big problems.
    1. It just downloads all the files randomly... is there a way to make it wait until the first is done and then do the second one?

    2. Problem is it opens something like 40 version of FTP and doesnt close them
    what code can I use to close them?
     
  2. 5Gen_Prelude

    5Gen_Prelude There might not be an "I" in the word "Team", but

    Joined:
    Mar 14, 2000
    Messages:
    14,519
    Likes Received:
    1
    Location:
    Vancouver, BC, CANADA
    Don't bother posting the code - it makes it funner that way!
     
  3. GuOD

    GuOD mcflurry diet

    Joined:
    May 19, 2003
    Messages:
    7,366
    Likes Received:
    0
    Location:
    Toronto
    sorry i don't have the code with me... but it's just basic

    ...login with id/pass
    cd dir/

    "get blah.txt c:\data\blah.txt"
    "get blah2.txt c:\data\blah2.txt"
    "get blah3.txt c:\data\blah3.txt"


    ... end of file

    I just wondered how I can find out a list of commands that work with the ftp function... maybe to close the connections or something :dunno:
     
  4. 5Gen_Prelude

    5Gen_Prelude There might not be an "I" in the word "Team", but

    Joined:
    Mar 14, 2000
    Messages:
    14,519
    Likes Received:
    1
    Location:
    Vancouver, BC, CANADA
    Are you using the -s switch? It doesn't open 40 connections so I have no idea what you're talking about. You can see the ftp commands in Windows and in dos by typing ftp and then help.

    I'd like to help but you're not making much sense - posting the code and the ftp script would be useful.
     
  5. GuOD

    GuOD mcflurry diet

    Joined:
    May 19, 2003
    Messages:
    7,366
    Likes Received:
    0
    Location:
    Toronto
    Sorry - I don't have the code with me because I did it at work :mamoru:

    I just took some other code and manipulated it to get my files... I don't fully understand what it does. I blieve it's using a -s:c:\data\bat.bat or something.

    I'll get the code tomorrow and post.
     

Share This Page