+ Reply to Thread
Results 1 to 6 of 6

Accessing FTP through VBA Macro

  1. #1
    Registered User
    Join Date
    06-04-2005
    Posts
    2

    Accessing FTP through VBA Macro

    Question:

    Is it possible to program a macro to 1) go to a ftp site 2) download a file 3) unzip that file?

    This sounds possible, but I'm going nuts but I don't know how to begin.

    I know that in excel you can go to Data|Import|New Web Query and find the file...
    however I don't know how to go outside of Excel and unzip the file.

    Has anyone seen anything like this before?

    Rob

  2. #2
    Gary's Student
    Guest

    RE: Accessing FTP through VBA Macro

    The simplest way is to use an external script to access the FTP and then run
    the script through the SHELL function.

    See:
    http://support.microsoft.com/default.aspx?kbid=96269
    --
    Gary's Student


    "robsix6" wrote:

    >
    > Question:
    >
    > Is it possible to program a macro to 1) go to a ftp site 2) download a
    > file 3) unzip that file?
    >
    > This sounds possible, but I'm going nuts but I don't know how to
    > begin.
    >
    > I know that in excel you can go to Data|Import|New Web Query and find
    > the file...
    > however I don't know how to go outside of Excel and unzip the file.
    >
    > Has anyone seen anything like this before?
    >
    > Rob
    >
    >
    > --
    > robsix6
    > ------------------------------------------------------------------------
    > robsix6's Profile: http://www.excelforum.com/member.php...o&userid=24045
    > View this thread: http://www.excelforum.com/showthread...hreadid=376564
    >
    >


  3. #3
    KL
    Guest

    Re: Accessing FTP through VBA Macro

    Hi robsix6,

    You may want to have a look at this:
    http://www.bygsoftware.com/Excel/VBA/ftp.htm

    Regards,
    KL


    "robsix6" <robsix6.1q48qa_1117911903.104@excelforum-nospam.com> wrote in
    message news:robsix6.1q48qa_1117911903.104@excelforum-nospam.com...
    >
    > Question:
    >
    > Is it possible to program a macro to 1) go to a ftp site 2) download a
    > file 3) unzip that file?
    >
    > This sounds possible, but I'm going nuts but I don't know how to
    > begin.
    >
    > I know that in excel you can go to Data|Import|New Web Query and find
    > the file...
    > however I don't know how to go outside of Excel and unzip the file.
    >
    > Has anyone seen anything like this before?
    >
    > Rob
    >
    >
    > --
    > robsix6
    > ------------------------------------------------------------------------
    > robsix6's Profile:
    > http://www.excelforum.com/member.php...o&userid=24045
    > View this thread: http://www.excelforum.com/showthread...hreadid=376564
    >




  4. #4
    KL
    Guest

    Re: Accessing FTP through VBA Macro

    Hi again,

    I also did something like this some time ago:

    1) Create a *.txt file, say c:\Batch.txt
    2) In the Batch.txt write the following script (change "ftp.server.com" the
    real FTP server, "UserName" to the real FTP server username, "Password" the
    real FTP acces password, "C:\MyFile.xls" to the name and directory of the
    file to be copied. Don't use quotation marks) :

    open ftp.server.com
    UserName
    Password
    send C:\MyFile.xls
    bye

    More info about switches here:
    http://www.computerhope.com/software/ftp.htm#04

    3) Run a code like this:

    Shell ("ftp -s:c:\Batch.txt")

    Reagrds,
    KL


    "KL" <NOSPAMlapink2000@PLEASEhotmail.com> wrote in message
    news:uejxaMVaFHA.3184@TK2MSFTNGP15.phx.gbl...
    > Hi robsix6,
    >
    > You may want to have a look at this:
    > http://www.bygsoftware.com/Excel/VBA/ftp.htm
    >
    > Regards,
    > KL
    >
    >
    > "robsix6" <robsix6.1q48qa_1117911903.104@excelforum-nospam.com> wrote in
    > message news:robsix6.1q48qa_1117911903.104@excelforum-nospam.com...
    >>
    >> Question:
    >>
    >> Is it possible to program a macro to 1) go to a ftp site 2) download a
    >> file 3) unzip that file?
    >>
    >> This sounds possible, but I'm going nuts but I don't know how to
    >> begin.
    >>
    >> I know that in excel you can go to Data|Import|New Web Query and find
    >> the file...
    >> however I don't know how to go outside of Excel and unzip the file.
    >>
    >> Has anyone seen anything like this before?
    >>
    >> Rob
    >>
    >>
    >> --
    >> robsix6
    >> ------------------------------------------------------------------------
    >> robsix6's Profile:
    >> http://www.excelforum.com/member.php...o&userid=24045
    >> View this thread:
    >> http://www.excelforum.com/showthread...hreadid=376564
    >>

    >
    >




  5. #5
    Nigel
    Guest

    Re: Accessing FTP through VBA Macro

    Others appear to provide a solution for the ftp question.
    In terms of unzippng the file have a look at RondeBruin site

    http://www.rondebruin.nl/unzip.htm


    --
    Cheers
    Nigel



    "robsix6" <robsix6.1q48qa_1117911903.104@excelforum-nospam.com> wrote in
    message news:robsix6.1q48qa_1117911903.104@excelforum-nospam.com...
    >
    > Question:
    >
    > Is it possible to program a macro to 1) go to a ftp site 2) download a
    > file 3) unzip that file?
    >
    > This sounds possible, but I'm going nuts but I don't know how to
    > begin.
    >
    > I know that in excel you can go to Data|Import|New Web Query and find
    > the file...
    > however I don't know how to go outside of Excel and unzip the file.
    >
    > Has anyone seen anything like this before?
    >
    > Rob
    >
    >
    > --
    > robsix6
    > ------------------------------------------------------------------------
    > robsix6's Profile:

    http://www.excelforum.com/member.php...o&userid=24045
    > View this thread: http://www.excelforum.com/showthread...hreadid=376564
    >




  6. #6
    Registered User
    Join Date
    06-04-2005
    Posts
    2
    I have checked these sites out and famililarized myself with Batch files and the shell code, yet don't know how to finalize and execute the batch file from within the VBA... Is that self explanatory?


    Thanks for the help
    Last edited by robsix6; 06-06-2005 at 09:36 AM. Reason: Addition

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1