Public Declare Function FindExecutableA Lib 'shell32.dll' _
(ByVal lpFile As String, ByVal lpdirectory As String, ByVal lpResult As String) As Long
Public Const MAX_FILENAME_LEN = 256
Function FindExecutable(s As String) As String
Dim i As Integer
Dim S2 As String
S2 = String(MAX_FILENAME_LEN, 32) & Chr$(0)
i = FindExecutableA(s & Chr$(0), vbNullString, S2)
If i > 32 Then
FindExecutable = Left$(S2, InStr(S2, Chr$(0)) - 1)
Else
FindExecutable = ''
End If
End Function
Sub cheminApplication()
Dim LeFichier As String
'LeFichier = 'WinWord.exe'
LeFichier = 'NotePad.exe'
MsgBox FindExecutable(LeFichier)
End Sub