Private Declare Function SearchTreeForFile Lib "imagehlp" (ByVal RootPath As String, ByVal InputPathName As String, ByVal OutputPathBuffer As String) As Long
Private Const MAX_PATH = 260
Private Function trouve(R As String, F As String, Ext As Variant) As String
Dim T As String, resu As Long
T = String(MAX_PATH, 0)
For i = LBound(Ext) To UBound(Ext)
F1 = F & Ext(i)
resu = SearchTreeForFile(R, F1, T)
If resu <> 0 Then
trouve = Left$(T, InStr(1, T, Chr$(0)) - 1): Exit Function
End If
Next
End Function
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
Dim MyFich$
If Target.Column = 1 And Target.Count = 1 And Target.Value <> Empty Then
Dim repertoire As String, fichier As String
repertoire = "C:\Résultats\"
fichier = Target.Text
MsgBox trouve(repertoire, fichier, Array(".xls", ".xlsx", ".xlsm"))
End If
End Sub '