Bonjour,
Avec un peu de retard...
Cdlt.
Option Explicit
Const PWD As String = "test"
Public Sub ProtectionWorkbook()
Dim ws As Worksheet, ws2 As Worksheet
Dim sh As Shape
Dim Msg As String, Title As String, Caption As String
Dim r As Variant
Set ws2 = ActiveSheet
Set sh = ws2.Shapes(1)
Caption = sh.TextFrame.Characters.Text
Select Case Caption
Case "VERROUILLER"
For Each ws In ActiveWorkbook.Worksheets
ws.Protect Password:=PWD, UserInterfaceOnly:=True
Next ws
sh.TextFrame.Characters.Text = "DEVEROUILLER"
Case "DEVEROUILLER"
Msg = "Saisissez le mot de passe."
Title = "Mot de passe ?"
r = Application.InputBox(prompt:=Msg, Title:=Title, Type:=2)
Select Case r
Case PWD
For Each ws In ActiveWorkbook.Worksheets
ws.Unprotect Password:=PWD
Next ws
sh.TextFrame.Characters.Text = "VERROUILLER"
ws2.Activate
Case False: Exit Sub
Case Else
Msg = "Le mot de passe n'est pas valide"
MsgBox Msg, vbOKOnly + vbCritical, Title
Exit Sub
End Select
End Select
Set sh = Nothing: Set ws2 = Nothing
End Sub