?
Solved

excel VBA FTP

Posted on 2011-09-07
3
Medium Priority
?
336 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 2000 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Freeze panes is an option within all variants of Excel to enable parts of a sheet to remain stationary when the cursor is in another part of the sheet. This is a very useful feature which is overlooked or under used.
If you need to forecast numbers -- typically for finance -- the Windows and Mac versions of Excel 2016 have a basket of tools to get the job done.
The viewer will learn how to create two correlated normally distributed random variables in Excel, use a normal distribution to simulate the return on different levels of investment in each of the two funds over a period of ten years, and, create a …
This Micro Tutorial will demonstrate how to use longer labels with horizontal bar charts instead of the vertical column chart.

777 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