Bonjour le forum
Alors j'ai fait un macro pour protéger et déprotéger automatiquement la feuille active comme cela
Private Sub Worksheet_Activate()
Call Déprotéger
If ActiveSheet.FilterMode = True Then ActiveSheet.ShowAllData
Call Protéger
End Sub
avec le macro Protéger / Déprotéger
Sub Déprotéger()
ActiveSheet.Unprotect
End Sub
Sub Protéger()
'Exit Sub
On Error GoTo Protéger_Erreur
If ActiveSheet.Name = "Paramètres" Then
ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True _
, AllowFormattingCells:=True, AllowSorting:=True, AllowFiltering:=True, AllowUsingPivotTables:=True
Else
ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True _
, AllowFormattingCells:=False, AllowSorting:=True, AllowFiltering:=True, AllowUsingPivotTables:=True
End If
Protéger_exit:
Exit Sub
Protéger_Erreur:
MsgBox Error$
Resume Protéger_exit
End Sub
Mais le problème c'est que lorsque j'ajoute sur le macro Protéger le mode passe "PASSOWORD" il m'affiche toujours le message d’ôter la protection (voir l'mage ci- dessous),Alors est ce que c'est possible de n'affiche pas cette fenêtre d’ôter la protection de la feuille