Post a reply

Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)


Topic review


I think I solved the problem. It was on server side, due to automatic transfer resume.

"With SFTP protocol, when automatic transfer resume is enabled, WinSCP first uploads the file to a temporary file with .filepart extension. Only after the transfer is completed the file is renamed to its actual name."

I've deactivated this, and I live the VBA code here, for future uses:

TransferOptions.ResumeSupport.State = TransferResumeSupportState.TransferResumeSupportState_Off

Thanks, Martin, for all your help.

hi martin,

mail sent.


Thanks for your report.

Can you send me an email, so I can send you back a debug version of WinSCP to track the problem? Please include link back to this topic in your email. Also note in this topic that you have sent the email. Thanks.

You will find my address (if you log in) in my forum profile.

Added. Thanks.

Re: VBA --- Timeout waiting for WinSCP to respond

Try to run just a simple script file like: /log=session.log /ini=nul /script=script.txt

with script.txt:

open "s" -hostkey="*" -privatekey="C:/xxxx/PrivateKey.ppk" -timeout=600

put  -nopermissions -preservetime -transfer="binary" -- "\\xxxx\*" "/in/"

What does it do? Post a log file.


Added logs + debug for both cases OK & NOK.

Re: VBA --- Timeout waiting for WinSCP to respond

We need corresponding debug log files too. See my previous post.

And a log when it had only 84 files to transfer, and, of course, it worked.

Hi, I generated a log today, when it failed, having to upload 287 files.

Re: VBA --- Timeout waiting for WinSCP to respond

Please attach a full session and debug log file showing the problem (using the latest version of WinSCP).

To generate the log files, set Session.SessionLogPath and Session.DebugLogPath. Submit the logs with your post as an attachment. You may want to remove data you consider sensitive (unless they are relevant to the problem). If you do not want to post the log publicly, you can mark the attachment as private.

VBA --- Timeout waiting for WinSCP to respond


I've implemented WinSCP .NET Assembly for VBA, trying to upload files from a local folder through SFTP, but I'm getting "Timeout waiting for WinSCP to respond" when I try to upload a number of files bigger than 150 - 200.
Of course, I've tried using .TimeoutInMilliseconds and I've increased it and tested even with 900000.

If I transfer only 100 files, it's ok with values much much lower than 900000. BTW, what is the MAX value for TimeoutInMilliseconds?
When I get the timeout error, it fails without transferring any file, so this makes me understand that it fails at the part when WinSCP evaluates the number of files & dimension it has to transfer, before starting the transfer.

The files are .zip and have in average 110 KB, so the transferred values are not so big, between 20MB-45MB per day.

With mySessionOptions
.Protocol = Protocol_Sftp
.TimeoutInMilliseconds = 600000
.HostName = ""
.UserName = "xxxxx"
.GiveUpSecurityAndAcceptAnySshHostKey = True
.SshPrivateKeyPath = "C:/xxxx/PrivateKey.ppk"
End With

And the transfer is done like:

' Upload files
Dim myTransferOptions As New TransferOptions
myTransferOptions.TransferMode = TransferMode_Binary

Dim transferResult As TransferOperationResult
Set transferResult = mySession.PutFiles("\\local\path\*", "/in/", False, myTransferOptions)

Thanks in advance for your advices.