Re: How to incorporate FileTransferProgress in VBA
@Arun: Did you follow the instructions?
https://winscp.net/eng/docs/library_install#registering
https://winscp.net/eng/docs/library_install#registering
Before posting, please read how to report bug or request support effectively.
Bug reports without an attached log file are usually useless.
Dim mySessionOptions As New WinSCPnet.SessionOptions
With mySessionOptions ' Getting error here ActiveX component can't create object
FileTransferProgress
event/class, but can't seem to link the FileTransferProgress
into VBA. Can anyone help me on this.
Private Sub download(ByRef mySession As Session)
' Setup session options
Dim mySessionOptions As New SessionOptions
With mySessionOptions
.Protocol = Protocol_Webdav
.HostName = "abcd.com"
.PortNumber = 443
.UserName = "username"
.Password = "password"
.WebdavSecure = True
.TlsClientCertificatePath = "path_to_key"
End With
' Connect
mySession.Open mySessionOptions
NameFile = "name_of_file"
RemotePath = "name_of_file"
Dim transferResult As TransferOperationResult
Set transferResult = mySession.GetFiles(RemotePath, NameFile, False)
' Throw on any error
transferResult.check
' Display results
Dim transfer As TransferEventArgs
For Each transfer In transferResult.Transfers
MsgBox "Downloaded"
Next
End Sub