That did the trick! :D
Thank you very much!
Saludos from Barcelona
Thank you very much!
Saludos from Barcelona
SessionOptions.SshPrivateKeyPassphrase
, not SessionOptions.Password
.
SessionOptions.SshPrivateKeyPassphrase
is deprecated and renamed to SessionOptions.PrivateKeyPassphrase
since WinSCP 5.8 beta.
Sub Conectar()
Dim MySession As New WinSCPnet.Session
Dim MySessionOptions As New WinSCPnet.SessionOptions
On Error GoTo ErrorHandler
MySession.SessionLogPath = CurrentProject.Path & "\Log\Log.txt"
With MySessionOptions
.Protocol = Protocol_Sftp
.HostName = "ddddddddd.de.db.com"
.UserName = "U111111"
.Password = "MyPass"
.PortNumber = 22
.SshHostKeyFingerprint = "ssh-dss 1024 26:b7:f5:fa:0e:0c:71:e6:3a:6e:de:b7:a9:d7:26:41"
.SshPrivateKeyPath = "C:\Users\U111111\privatekeywinscp.ppk"
End With
MySession.Open MySessionOptions
ExitProcedure:
MySession.dispose
Set MySessionOptions = Nothing
Set MySession = Nothing
Exit Sub
ErrorHandler:
MsgBox Err.Number & " - " & Err.Description
GoTo ExitProcedure
End Sub