Ouvrir un répertoire dans Explorer.exe
- Code : Tout sélectionner
Sub WindowsOpenPath(wPath As String)
'Déclaration variable
Dim vrShell As Variant
Dim Path As String
On Error Goto ErreurHandle
Path = "C:\"
If Trim(wPath)<>"" Then
If DirectoryIsValide(Trim(wPath)) = True Then
Path = Trim(wPath)
End If
End If
Set vrShell = CreateObject("WScript.Shell")
vrShell.Exec("explorer "+Path)
Set vrShell = Nothing
Exit Sub
ErreurHandle:
Msgbox "("+Cstr(Getthreadinfo (1))+" Call by "+Cstr(Getthreadinfo(10))+")"+Chr(10)+"Erreur " + Str(Err) + " : "+Chr(10) + Cstr(Error)+". "+Chr(10)+"Ligne N° "+Cstr(Erl),16," ERREUR !"
Exit Sub
End Sub