Hello,
Im trying to upload a file with SFTP using VBA, is it possible ?
I found this code but I dont know what I need to change to use it.
I will be happy for some help.
Thank you !
Im trying to upload a file with SFTP using VBA, is it possible ?
I found this code but I dont know what I need to change to use it.
Code:
Public Sub SFTPGet(fname As String)
Const cstrSftp As String = """mylink.com/pscp.exe"""
Dim strCommand As String
Dim pUser As String
Dim pKey As String
Dim pHost As String
Dim pFile As String
Dim pLocalPath As String
pUser = "user1"
pKey = """" & BILLING_FOLDER & "some_private.ppk"""
pFile = "someplace/data" & fname
pLocalPath = """" & sInputFileFolder & "."""
strCommand = cstrSftp & " -sftp -l " & pUser & " -i " & pKey & " " & pFile & " " & pLocalPath
Shell strCommand
End Sub
I will be happy for some help.
Thank you !
Last edited: