Topic "How can I define EnumerateOptions in VBA"

Author Message
lcao

Guest


hi, there. How can I get the file list by filtering file name starting with something,say Report_?
I was thinking about using EnumeratFiles, but I can not define EnumerateOptions by the way below. please shred some light on it?


Dim remotePath As String
Dim mark As String
mark = "*.zip"
remotePath = "uat/download/"
Dim remotefile As New RemoteFileInfoCollection
Dim options As New EnumerateOptions
Set options = EnumerateOptions_None
Set remotefile = mysession.EnumerateFiles(remotePath, mark, options)
Advertisements
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24991
Location: Prague, Czechia
The enumeration type is EnumerationOptions, not EnumerateOptions.
The method is EnumerateRemoteFiles, not EnumerateFiles.

See https://winscp.net/eng/docs/library_session_enumerateremotefiles
lcao

Guest


martin wrote:
The enumeration type is EnumerationOptions, not EnumerateOptions.
The method is EnumerateRemoteFiles, not EnumerateFiles.

See https://winscp.net/eng/docs/library_session_enumerateremotefiles



corrected the syntax as you pointed out early,thanks for that. and tried 3 different dim method, all 3 got the same wrong compile error. is there any other things I could do wrong?
Capture.JPG (56.83 KB)

Description: (none)

Capture.JPG

martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24991
Location: Prague, Czechia
Your code works for me. Are you sure you have the latest version of WinSCP .NET assembly registered for COM? Maybe you need to unregister an older version, if you were using some before. You can have one version registered only.
Advertisements

You can post new topics in this forum






Search Site

What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!

Donate

About donations

$9   $19   $49   $99

About donations

Recommend

WinSCP Privacy Policy

WinSCP License