ceci fonctionne très bien chez moi
Option Explicit
' activer Microsoft Shell Controls and Automation
Public Sub Exemple()
Dim myFolderItem As FolderItem
Cells.Clear
Dim i&
i = 1
For Each myFolderItem In ftpList("ftp.xxxxx.fr/www", "user", "pwd") ' username: anonymous, password: anonymous
If myFolderItem.Name Like "*.*" Then Cells(i, 1) = myFolderItem.Name: i = i + 1
Next
End Sub
Private Function ftpList(strFTPlocation As String, Optional strUser As String, Optional strPassword As String) As FolderItems
Dim myShell As New Shell
Dim strConnect As String
If strUser <> "" Then strConnect = strUser & ":" & strPassword & "@"
Set ftpList = myShell.Namespace("FTP://" & strConnect & strFTPlocation).Items '("ftp://user:password@ftp.site.com")
End Function
il faut parfois mettre
ftpList("ftp.xxxxx.fr/www", "anonymous", "anonymous")
une fois la liste établie, tu la compares avec la liste des mots-clés