+ Reply to Thread
Results 1 to 5 of 5

Upload files via ftp in excel

  1. #1
    Registered User
    Join Date
    04-08-2005
    Posts
    5

    Upload files via ftp in excel

    Is it possible to have code that will upload files to a server in amongst the vb macro code. I have an excel program that spits out a lot of htm files and the program could also upload them in one that would be very handy.

    Any help would be really good thanks

  2. #2
    Forum Contributor
    Join Date
    11-16-2004
    Posts
    282

    Sending files to FTP server in Visual Basic

    Yes it is possible to upload files to an ftp server, but there are a few prerequisites…

    Before you can save a workbook to an FTP site, you must add the FTP site to your list of FTP locations in the Excel application. From Excel Help:
    Add an FTP site to the list of FTP locations
    To add an FTP site to the list of FTP locations in the Save As and Open dialog boxes, you must have access to the FTP site. You can gain access to an FTP site either through a direct network connection to the Internet or through a dial-in Internet service provider. For information about how to set up Internet access, see the Microsoft Office 2000 Resource Kit, available at the Microsoft Web site.
    Note You must have your proxy settings set correctly to modify or add an FTP location. Contact your system administrator for the correct proxy setting.
    1. Click Open .
    2. In the Look in list, click Add/Modify FTP Locations.
    3. In the Name of FTP site box, type the FTP server name; for example, ftp.microsoft.com
    4. Do one of the following:
    If you want to log on anonymously and the site permits this, click Anonymous.
    If you have a user account at the site and want to use it to log on, click User, and then type your user name in the User box.
    5. If you do not want to be prompted for your password each time you open or save files at the site, type your password in the Password box.
    6. Click Add.
    Once you’ve mapped the Excel application to an FTP site, in your VB code you use the SaveAs method to save the file to the FTP site (change filename below to your reference):
    Please Login or Register  to view this content.
    Hope this helps,
    theDude

  3. #3
    Registered User
    Join Date
    04-08-2005
    Posts
    5
    excellent.
    Thanks thedude

    only one more thing. Everytime I restart windows I have to add in the FTP information all over again. Is there anyway that I can permanently store this here so I don't have to keep adding it in (every day!)

  4. #4
    Forum Contributor
    Join Date
    11-16-2004
    Posts
    282
    After you entered the ftp location and clicked the 'Add' button, did you click the 'OK' button? I'm running Excel 2000 and once I add an ftp location and click 'OK', when I use the File->Save As menu and select the Save In dropdown in the dialog screen, my ftp locations remain as selections in the FTP Locations category at the bottom of the dropdown list.

    Hope this helps,
    theDude

  5. #5
    Registered User
    Join Date
    04-08-2005
    Posts
    5
    Hmm no, it stays there for a bit, but everytime I restart windows (or basically after a bit of time - like a day), then it's not there anymore and I have to enter the details again (and yes, I do press Add-Ok.....

+ 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