Bonjour,
Dans ce cas il faut se renseigner sur la méthode Workbook.SaveAs. Je te propose un code ci-dessous. Est-ce que cela correspond à ton besoin ?
Sub Protect()
Dim Wb As Workbook
Dim Wb1URL As String, Wb2URL As String, Wb3URL As String
Dim Wb1Mdp As String, Wb2Mdp As String, Wb3Mdp As String
On Error GoTo ErrorProtect
Wb1URL = "C:.....\Classeur1.xlsx"
Wb2URL = "C:.....\Classeur2.xlsx"
Wb3URL = "C:.....\Classeur3.xlsx"
Wb1Mdp = "Mot de passe 1"
Wb2Mdp = "Un autre MDP"
Wb3Mdp = "Coucou"
Application.ScreenUpdating = False
Set Wb = Application.Workbooks.Open(Wb1URL): Wb.SaveAs Wb1URL, , Wb1Mdp: Wb.Close: Set Wb = Nothing
Set Wb = Application.Workbooks.Open(Wb2URL): Wb.SaveAs Wb2URL, , Wb2Mdp: Wb.Close: Set Wb = Nothing
Set Wb = Application.Workbooks.Open(Wb3URL): Wb.SaveAs Wb3URL, , Wb3Mdp: Wb.Close: Set Wb = Nothing
Application.ScreenUpdating = True
Exit Sub
ErrorProtect:
Application.ScreenUpdating = True
MsgBox "Une erreur est survenue pendant le processus de protection des classeurs.", vbCritical
End Sub