0

I am looking for a code like we have in ftp for sftp which can be used to connect the server and from the given path downloads the file requested.

Can this be done using a batch file or excel macro anyway direction would be appreciated.

I cannot use any client to do this job it has to be a batch file or macro that does the work.

EDIT:

Batch Code

open your.ftpserver.com
user yourUsername yourPassword
lcd C:\Downloads
cd yourRemoteFolder
binary
get "East Vat Account.xlsx"
bye

Macro to run batch file

Public Sub Ftp_Download_File()

    Dim FTPcommand As String
    Dim wsh As Object

    FTPcommand = "ftp -n -s:" & Chr(34) & "C:\FTP_commands.txt" & Chr(34)
    Set wsh = CreateObject("WScript.Shell")
    wsh.Run FTPcommand, 5, True

    Workbooks.Open "C:\Downloads\East Vat Account.xlsx"

End Sub
Sumeet Pujari
  • 181
  • 1
  • 5
  • 19

0 Answers0