Re: Can I use Session.EnumerateRemoteFiles() in VBA?
I found a "workaround" that perfectly fits my needs and may also help others in a similar situation.
Since I need to archive the respective file(s) I'm looking for anyway I now do this
(BTW, I'm more a C++/C# guy anyway, but sometimes you need to please "customers" that insist in using VBA 😁)
Since I need to archive the respective file(s) I'm looking for anyway I now do this
Dim result As WinSCPnet.TransferOperationResult
Set result = activeSession.GetFilesToDirectory(sftpPath, archivePath, fileNameWithWildcards)
' or when you want to remove the source file after archiving
'Set result = activeSession.GetFilesToDirectory(sftpPath, archivePath, fileNameWithWildcards, True)
' ... error checks here
If (result.IsSuccess()) Then
Dim tea As WinSCPnet.TransferEventArgs
For Each tea in resultTransfers
Debug.Print tea.FileName
Next tea
End If
(BTW, I'm more a C++/C# guy anyway, but sometimes you need to please "customers" that insist in using VBA 😁)