1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
| 'cette fonction déprotège la feuille Excel ciblée
Sub SheetUnprotect(ByVal sFeuilleADeproteger As String, ByVal Password As String, wsExcel As Excel.Worksheet)
Application.ScreenUpdating = False
'Worksheets(sFeuilleADeproteger).Unprotect (Password)
wsExcel.Unprotect (Password)
'ActiveWorkbook.Close savechanges:=True
MsgBox ("La feuille est déprotegée")
End Sub
Sub SheetProtect(ByVal sFeuilleADeproteger As String, ByVal Password As String, wsExcel As Excel.Worksheet)
Application.ScreenUpdating = False
'Worksheets(sFeuilleADeproteger).Unprotect (Password)
wsExcel.Select
wsExcel.Protect (Password)
'ActiveWorkbook.Close savechanges:=True
MsgBox ("La feuille est protegée")
End Sub |
Partager