+ Reply to Thread
Results 1 to 8 of 8

Help! Need VBA code for login FtpServer

  1. #1
    Registered User
    Join Date
    09-27-2011
    Location
    Hong Kong
    MS-Off Ver
    Excel 2010
    Posts
    17

    Red face Help! Need VBA code for login FtpServer

    Hi,
    I am using the following VBA code generated from Excel Marco , to publish the file every 20seconds to my FTP server. However, it created many active FTP sessions and connection was very slow..up to 25 seconds...for only 150K file. Hosting Company wanted me to modify VBA and I dont know how.
    Please Login or Register  to view this content.
    I hope someone can help me to rewrite / modify the above code, so i can connect to ftpserver more quickly and fewer FTP sessions generated.
    suppose my ftp server is ftp://testserver.com , my user name is"triniti", password is"1234" and my publish file is file1.htm

    Thanks very much for your help....ThankYOU
    Last edited by triniti; 09-29-2011 at 02:04 PM. Reason: remove colour tags

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Help! Need VBA code for login FtpServer

    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code. Posting code without them makes your code hard to read and difficult to be copied for testing. Highlight your code and click the # at the top of your post window. For more information about these and other tags, found here
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  3. #3
    Registered User
    Join Date
    09-27-2011
    Location
    Hong Kong
    MS-Off Ver
    Excel 2010
    Posts
    17

    Re: Help! Need VBA code for login FtpServer

    added code tags. Thanks.

  4. #4
    Forum Expert Kenneth Hobson's Avatar
    Join Date
    02-05-2007
    Location
    Tecumseh, OK
    MS-Off Ver
    Office 365, Win10Home
    Posts
    2,573

    Re: Help! Need VBA code for login FtpServer

    20 seconds is not much time. I hope that your FTP server people don't mind you doing that.

    See this thread for a BAT file method. You would need 3 BAT files. One to open the connection, 1 to send files, and 1 to close the connection. The same post as a link to an API method that might be easier for you. http://vbaexpress.com/forum/showthread.php?t=25482

  5. #5
    Registered User
    Join Date
    09-27-2011
    Location
    Hong Kong
    MS-Off Ver
    Excel 2010
    Posts
    17

    Re: Help! Need VBA code for login FtpServer

    Thanks Kenneth for your recommendations. I 'll try to digest it and give it a go and see.

  6. #6
    Forum Expert snb's Avatar
    Join Date
    05-09-2010
    Location
    VBA
    MS-Off Ver
    Redhat
    Posts
    5,649

    Re: Help! Need VBA code for login FtpServer

    You only need 1 script and only 1 VBA line to run the script.
    Once the script is on your system running the macro 'run_fte_script" suffices.

    To illustrate how to make a script using VBA: (send all Ecxelfiles in 'E:\' to folder 'ftp..../test')
    Please Login or Register  to view this content.


    Running the script
    Please Login or Register  to view this content.
    testserver.com is the website without 'www.'
    Last edited by snb; 09-27-2011 at 03:18 PM.



  7. #7
    Registered User
    Join Date
    09-27-2011
    Location
    Hong Kong
    MS-Off Ver
    Excel 2010
    Posts
    17

    Re: Help! Need VBA code for login FtpServer

    WoW...Thanks SnB, very clean code, i will try it out . Thanks.

  8. #8
    Registered User
    Join Date
    09-27-2011
    Location
    Hong Kong
    MS-Off Ver
    Excel 2010
    Posts
    17

    Re: Help! Need VBA code for login FtpServer

    Codes Worked Perfect. Great Help. Thanks Snb.

+ 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