title: Download excel file from sFtp server using batch file
body: <p>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.</p>
  
  <p>Can this be done using a batch file or excel macro anyway direction would be appreciated.</p>
  
  <p>I cannot use any client to do this job it has to be a batch file or macro that does the work.</p>
  
  <p>EDIT:</p>
  
  <p>Batch Code</p>
  
  <pre><code>open your.ftpserver.com
  user yourUsername yourPassword
  lcd C:\Downloads
  cd yourRemoteFolder
  binary
  get "East Vat Account.xlsx"
  bye
  </code></pre>
  
  <p>Macro to run batch file</p>
  
  <pre><code>Public Sub Ftp_Download_File()
  
      Dim FTPcommand As String
      Dim wsh As Object
  
      FTPcommand = "ftp -n -s:" &amp; Chr(34) &amp; "C:\FTP_commands.txt" &amp; Chr(34)
      Set wsh = CreateObject("WScript.Shell")
      wsh.Run FTPcommand, 5, True
  
      Workbooks.Open "C:\Downloads\East Vat Account.xlsx"
  
  End Sub
  </code></pre>