Code to SFTP

jstevens
GoldLounger
Posts: 2628
Joined: 26 Jan 2010, 16:31
Location: Southern California

Code to SFTP

Post by jstevens »

Is it possible to save a file directly to a SFTP site?

I have the name of the SFTP, UserID, Password, Port and Path.

Thanks,
John
Regards,
John

User avatar
HansV
Administrator
Posts: 78383
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Code to SFTP

Post by HansV »

No, you have to save the workbook to disk first and transfer that.
Best wishes,
Hans

jstevens
GoldLounger
Posts: 2628
Joined: 26 Jan 2010, 16:31
Location: Southern California

Re: Code to SFTP

Post by jstevens »

Hans,

Okay if the file is saved, what would the transfer code look like?

Regards,
John
Regards,
John

User avatar
HansV
Administrator
Posts: 78383
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Code to SFTP

Post by HansV »

I don''t know anything about sftp, but I guess you'd have to find out what command line you'd need, then use

Shell "sftp ..."

where "sftp ..." is the command line. If you want to get fancy, use ShellWait (from API: Shell and Wait) - it will wait until the transfer is completed.
Best wishes,
Hans

cecil
StarLounger
Posts: 98
Joined: 09 Sep 2010, 16:01

Re: Code to SFTP

Post by cecil »

I have not done SFTP, but for FTP I always used the Shell-N-Wait that Hans pointed to. I would always pick up the return code to verify success or to notify if failure.