Sub CopierModules()
Dim chemin$, fso As Object, sf As Object, f As Object
chemin = ThisWorkbook.Path & "\" '"F:\Trames\CONTROLES CLIENTS\"
Set fso = CreateObject("Scripting.FileSystemObject")
Application.ScreenUpdating = False
Application.EnableEvents = False 'si nécessaire
On Error Resume Next
For Each sf In fso.GetFolder(chemin).SubFolders
For Each f In sf.Files
If f.Name <> ThisWorkbook.Name And f.Name Like "*.xls" Then
With Workbooks.Open(f.Path)
With .VBProject
.VBComponents.Remove .VBComponents("Module2")
.VBComponents.Import(chemin & "Module2.txt").Name = "Module2"
.VBComponents.Remove .VBComponents("Module3")
.VBComponents.Import(chemin & "Module3.txt").Name = "Module3"
End With
.Close True
End With
End If
Next f, sf
Application.EnableEvents = True
End Sub