Sub OuvrirFichier()
Dim FichierAOuvrir As Variant, CheminCourant As String, LecteurCourant
CheminCourant = ThisWorkbook.Path
LecteurCourant = Left(CheminCourant, 1)
' on s'assure que l'on part du repertoire courant
ChDir CheminCourant
'permet de changer le répertoire de recherche, mais PAS le lecteur !!!
'------------utiliser alors ChDrive="D"
ChDir "C:\users\Public\Documents" ' <=======indiquer ici le chemin complet souhaité
'------------ ou bien le chemin à partir du repertoire courant
' ChDir "SousDossier\Factures"
' ChDir "..\Factures" pour un dossier parallele ..\ pour remonter d'un niveau
FichierAOuvrir = Application _
.GetOpenFilename("Text Files (*.ini), *.ini")
If FichierAOuvrir <> False Then
Application.StatusBar = CheminCourant & "------>" & FichierAOuvrir
'---------------- code à remplacer pour exploitation
MsgBox "Open " & FichierAOuvrir
'----------------affichage barre de status
End If
' on restitue le lecteur initial
ChDrive LecteurCourant
' on restitue le repertoire courant
ChDir CheminCourant
'Application.StatusBar = ""
End Sub