ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Save to FTP (https://www.excelbanter.com/excel-programming/293862-save-ftp.html)

cogent

Save to FTP
 
Hello

I am trying to automate a save to my ftp site, but there does not seem to be
a way to do it without user intervention. Using the following code, I still
get a dialog box asking for user (required) and password:

Sub SaveFTP()
Application.DisplayAlerts = False
ActiveWorkbook.SaveAs FileName:= _
"ftp://208.37.158.126/home/data/myfile.csv", FileFormat:= _
xlCSV, Password:="juicy122", WriteResPassword:="",
ReadOnlyRecommended:=False _
, CreateBackup:=True
End Sub

Any ideas?

W



shockley

Save to FTP
 
The password you are using with the SaveAs method is for opening the
workbook you are saving, not for accessing the ftp server. One way to
automate this upload would be to write a dos batch script using ftp
commands. You can get help on these commands he
http://www.computerhope.com/software/ftp.htm#04

As an example script here's one I wrote for uploading the file "SP.xls" to
my ftp server:

open ftp.frontiernet.net
user shockley 'username
mypet 'password
cd public_html 'the directory on the server containing my files
binary
put SP.xls
quit

Save the script as a .bat file and call it using the Shell command, eg.,

Shell ("G:\Batch\ftp00.bat")

HTH,
Shockley



"cogent" wrote in message
...
Hello

I am trying to automate a save to my ftp site, but there does not seem to

be
a way to do it without user intervention. Using the following code, I

still
get a dialog box asking for user (required) and password:

Sub SaveFTP()
Application.DisplayAlerts = False
ActiveWorkbook.SaveAs FileName:= _
"ftp://208.37.158.126/home/data/myfile.csv", FileFormat:= _
xlCSV, Password:="juicy122", WriteResPassword:="",
ReadOnlyRecommended:=False _
, CreateBackup:=True
End Sub

Any ideas?

W






All times are GMT +1. The time now is 12:24 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com