Sub Principale()
Dim repertoire As String, nom_fichier_de As String
Dim fd As FileDialog
'initialisaton des variables
Set Fichier_Vers = ActiveWorkbook
'ouverture du fichier à récuperer
Set fd = Application.FileDialog(msoFileDialogFilePicker)
'Use a With...End With block to reference the FileDialog object.
With fd
'Use the Show method to display the File Picker dialog box and return the user's action. The user pressed the action button.
If .Show = -1 Then
repertoire = fd.InitialFileName
nom_fichier_de = fd.SelectedItems.Item(1)
'ouverture du fichier
Workbooks.Open nom_fichier_de
'nom_fichier_de = Replace(nom_fichier_de, repertoire, "")
Set Fichier_De = ActiveWorkbook
'traitement
Traitement Fichier_De
'fermeture du fichier
' Fichier_De.Close False
End If
End With
'Set the object variable to Nothing.
Set fd = Nothing
End Sub