Solved

excel VBA FTP

Posted on 2011-09-07
3
326 Views
Last Modified: 2012-05-12
Hello all,  trying to see if this is possible and can be encoded.  After the last line in my vba code to transfer the in C:\Users\data\mysummary.pdf, C:\Users\data\mysummary.html, and C:\Users\data\filelist.html to my webserver via FTP.  I have my username and password to my FTP, just looking on a way to do this.  Thanks.
0
Comment
Question by:sandramac
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 15

Expert Comment

by:Minh Võ Công
ID: 36500521
Do you want download or upload file?
0
 

Author Comment

by:sandramac
ID: 36500730
Looking to upload
0
 
LVL 16

Accepted Solution

by:
AlexPace earned 500 total points
ID: 36504204
You could write a Robo-FTP script to upload files with these names to the remote site.  You can use the -s command line switch when you launch Robo-FTP so it automatically runs your script.  If you don't know the exact name of the files before your process runs, you could pass them on the command line also using the -p1 -p2 and -p3 arguments as described in this excerpt from the help file:
-pX arg    Define Shortcut Target argument
Use of the -pX switch is the preferred method to pass external arguments into Robo-FTP from a shortcut or the Windows Command Prompt command line. The value X must be the single digit 1 - 9. Therefore, up to nine arguments may be passed this way and are assigned to internally defined script file variables %1 through %9. The single space between X and arg is required.

The advantage to this method over the legacy method (see below) is that Windows environment variables (e.g.,  %SystemDrive%, %USERNAME%, etc.) as well as user defined strings may be passed into Robo-FTP. Consider this example where the name of a file to process is passed on the command line:
    C:\program files\robo-ftp 3.7\robo-ftp.exe -p1 FridaySales.xls

The values could then be used by Robo-FTP as follows:
    SENDFILE %1

... or you could invoke Robo-FTP using COM instead of running it as an external executable.  This allows control to remain inside of your VBA function and you could just feed Robo-FTP commands one at a time.  Here is an example showing how to do that as a VBScript so it should be fairly easy to convert to VBA:  http://www.robo-ftp.com/help/3.7/sample_vbscript.htm
0

Featured Post

Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This Article briefly covers methods of calculating the NPV and IRR variants in Excel as well as the limitations in calculating and interpreting IRR results. Paraphrasing Richard Shockley, author of my favourite finance reference tex…
This tutorial explains how to create a series of drop-down lists that are dependent upon prior selections to guide (“force”) the user to make the correct selection and reduce data errors within Microsoft Excel. Excel 2010 was used for this tutorial;…
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
This Micro Tutorial will demonstrate in Google Sheets how to use the HYPERLINK function to create live links inside your spreadsheet.

717 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question