Sub essai()
repertoire = ThisWorkbook.Path ' adapter
nf = Dir(repertoire & "\*.xls") 'premier fichier
Do While nf <> ""
If nf <> ThisWorkbook.Name Then
Workbooks.Open Filename:=nf
[A1] = "xxx"
ActiveWorkbook.Save
ActiveWorkbook.Close
nf = Dir ' fichier suivant
End If
Loop
End Sub
Sub essai()
repertoire = ThisWorkbook.Path ' adapter
nf = Dir(repertoire & "\*.xls") 'premier fichier
Do While nf <> ""
If nf <> ThisWorkbook.Name Then
Workbooks.Open Filename:=nf
ActiveWindow.DisplayWorkbookTabs = True
Sheets("MATIERE").Select
ActiveSheet.Unprotect
[P30].formulalocal = "=max(p26:q26)"
ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
Sheets("FICHE").Select
ActiveWindow.DisplayWorkbookTabs = False
ActiveWorkbook.Save
ActiveWorkbook.Close
nf = Dir ' fichier suivant
End If
Loop
End Sub
Workbooks.Open Filename:=nf