Twitter iPhone pliant OnePlus 11 PS5 Disney+ Orange Livebox Windows 11

Function ISPROTECTED ?

2 réponses
Avatar
LANIMAL
Bonsoir,
La fonction ISPROTECTED n'existe pas.
Alors je cherche un code qui permettrait de savoir si Feuil1 est protégée.
J'ai pensé tester ainsi :
On Error Resume Next
Range(une cellule verrouillée)= 99
...
...

Par curiosité, si ce n'est abuser,
j'aimerais savoir si il existe plus simple et plus direct.

Merci
Michel

2 réponses

Avatar
isabelle
bonjour Michel,

If ActiveSheet.ProtectContents Then MsgBox "La feuille est protégée"

'voir aussi
'If Worksheets("Sheet1").ProtectDrawingObjects then
'If Worksheets("Sheet1").ProtectScenarios Then
'If ActiveWorkbook.ProtectWindows = True Then
'If ActiveWorkbook.ProtectStructure = True Then

isabelle

LANIMAL a écrit :
Bonsoir,
La fonction ISPROTECTED n'existe pas.
Alors je cherche un code qui permettrait de savoir si Feuil1 est
protégée.
J'ai pensé tester ainsi :
On Error Resume Next
Range(une cellule verrouillée)= 99
...
...

Par curiosité, si ce n'est abuser,
j'aimerais savoir si il existe plus simple et plus direct.

Merci
Michel


Avatar
LANIMAL
Merci

isabelle a écrit :
bonjour Michel,

If ActiveSheet.ProtectContents Then MsgBox "La feuille est protégée"

'voir aussi
'If Worksheets("Sheet1").ProtectDrawingObjects then
'If Worksheets("Sheet1").ProtectScenarios Then
'If ActiveWorkbook.ProtectWindows = True Then
'If ActiveWorkbook.ProtectStructure = True Then

isabelle

LANIMAL a écrit :
Bonsoir,
La fonction ISPROTECTED n'existe pas.
Alors je cherche un code qui permettrait de savoir si Feuil1 est
protégée.
J'ai pensé tester ainsi :
On Error Resume Next
Range(une cellule verrouillée)= 99
...
...

Par curiosité, si ce n'est abuser,
j'aimerais savoir si il existe plus simple et plus direct.

Merci
Michel