Bonjour,
J'ai un gros souci pour renvoyer une classe après l'eut trouvé dans une collection par l'utilisation d'un boucle forEach.
Quel est mon erreur ?
Merci d'avance pour vos suggestions.
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24 Function checkFileExtention(FilePath As String, FileExtentions As Collection) As FileExtention mExtention = Right(FilePath, Len(FilePath) - InStr(1, FilePath, ".", vbTextCompare)) Debug.Print "L'extention du fichier : " & mExtention For Each mFileExtention In FileExtentions Debug.Print mFileExtention.FileExt() + " " + mFileExtention.FileExtAction() If mExtention = mFileExtention.FileExt() Then Debug.Print "Match finding" + vbCrLf + _ " Extention :" & mFileExtention.FileExt + vbCrLf + _ " Action : " + mFileExtention.FileExtAction Set checkFileExtention = mFileExtention Exit For End If Next End Function
Partager