Still no luck putting a file to the server ...I have verified that I am connecting and disconnecting, but I need to know where and how to include the PUT command in the strCommand of my code as every way I have tried it is either incorrect syntax or in the method below it accepts the code format but isn't putting a file to the server. Any help would be greatly appreciated.
Public Sub SftpPut()
Const cstrSftp As String = """C:\Users\eay41o7\Downloads\putty\pscp.exe"""
Dim strCommand As String
Dim pUser As String
Dim pPass As String
Dim pHost As String
Dim pFile As String
Dim pRemotePath As String
pUser = "CareAdvantage"
pPass = "CareAdvantage01"
pHost = "mshrasftp.mckesson.com"
pFile = "O:\Corporate\FortWorth\SpecPharmacy\Report Repository CADV\Reports\Takeda_Shipping_Conf_Daily\Takeda_Data.txt"
pRemotePath = "/home/tomck/"
strCommand = cstrSftp & " -scp -l " & pUser & " -pw " & pPass & _
" put " & pFile & " " & pHost & ":" & pRemotePath
Debug.Print strCommand
Shell strCommand, 1 ' vbNormalFocus '
End Sub
Public Sub SftpPut()
Const cstrSftp As String = """C:\Users\eay41o7\Downloads\putty\pscp.exe"""
Dim strCommand As String
Dim pUser As String
Dim pPass As String
Dim pHost As String
Dim pFile As String
Dim pRemotePath As String
pUser = "CareAdvantage"
pPass = "CareAdvantage01"
pHost = "mshrasftp.mckesson.com"
pFile = "O:\Corporate\FortWorth\SpecPharmacy\Report Repository CADV\Reports\Takeda_Shipping_Conf_Daily\Takeda_Data.txt"
pRemotePath = "/home/tomck/"
strCommand = cstrSftp & " -scp -l " & pUser & " -pw " & pPass & _
" put " & pFile & " " & pHost & ":" & pRemotePath
Debug.Print strCommand
Shell strCommand, 1 ' vbNormalFocus '
End Sub