Bonjour,
Cette macro ouvre tous les classeurs (xlsx) dans le répertoire que tu choisis :
Sub galopin()
Dim MyPath$, MyFile$, Rep As FileDialog
Set Rep = Application.FileDialog(msoFileDialogFolderPicker)
Rep.Show
MyPath = Rep.SelectedItems(1) & "\"
MyFile = Dir(MyPath & "*.xlsx")
Do While MyFile <> ""
Workbooks.Open (MyPath & MyFile)
MyFile = Dir
Loop
End Sub
ou encore pour reprendre ton embryon de code (sans possibilité de choix) :
Sub OuvrirClasseur()
Dim MyFile$, MyPath$
MyPath = "J:\jihane\"
MyFile = Dir(MyPath & "*.xlsx")
Do While MyFile <> ""
Workbooks.Open (MyPath & MyFile)
MyFile = Dir
Loop
End Sub
A+