1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
|
Sub ProtectAndSave()
Application.DisplayAlerts = False
Dim nom As String
nom = InputBox("Quel est le nom du fichier ?")
Do
If nom = "" Then
Exit Do
Else
Sheets("Config").Visible = False
Sheets("Listes_deroulantes").Visible = False
Worksheets("Template").Protect Password:="feuil", contents:=True
ActiveWorkbook.Protect Password:="classeur", Structure:=True, Windows:=True
With ActiveWorkbook
.SaveAs Filename:=ThisWorkbook.Path & "\" & nom & " - template.xlsx", FileFormat:=xlOpenXMLWorkbook
End With
End If
Loop
End Sub |