VBA Code to FTP files

oakleyfoy

New Member
Joined
Aug 17, 2016
Messages
3
I have an excel spreadsheet that is currently running VBA and creating .pdf's from different spreadsheets. I would like for those .pdf's to then be FTP up to my webserver in the same VBA. Is that possible? Thanks in advance for any help!
 

Excel Facts

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.
i use this:

Code:
'''Upload_Web_page

myPath = "c:\results\upcode" 'path where batch file is saved
WebFileName = "myfile"

''''''''write script.dat and upload.dat file
    
    Set fs = CreateObject("Scripting.FileSystemObject")
    Set A = fs.CreateTextFile(myPath & "\script.dat", True)
    A.writeline "username" 'username
    A.writeline "password" 'username
    A.writeline "lcd " & myPath 'file location
    A.writeline "cd www"
    A.writeline "put " & WebFileName & ".pdf" 'file name
    A.writeline "quit"
    A.Close
    
    Set fs = CreateObject("Scripting.FileSystemObject")
    Set A = fs.CreateTextFile(myPath & "\upload.bat", True)
    
    A.writeline "ftp -i -s:" & myPath & "\script.dat ftp.mysite.com"
    A.Close
    dRetVal = Shell(myPath & "\upload.bat", 0)
    ''''''''''end upload.bat file

hth,
Ross
 
Upvote 0
Upvote 0

Forum statistics

Threads
1,223,227
Messages
6,170,848
Members
452,361
Latest member
d3ad3y3

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top