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

Tester si un classeur est protégé

2 réponses
Avatar
defluc
Bonjour à tous

Je voudrais tester à l'intérieur d'une macro si le classeur actif est
protégé.

Merci d'avance

2 réponses

Avatar
FS
Bonjour,

Par exemple :

'======================= Function IsProtected(Wbk As Workbook) As Boolean
Dim x
With Wbk
x = .ProtectStructure + .ProtectWindows
End With
IsProtected = (x < 0)
End Function
'=======================
FS
--
Frédéric SIGONNEAU
Modules et modèles pour Excel :
http://frederic.sigonneau.free.fr/

defluc a écrit :
Bonjour à tous

Je voudrais tester à l'intérieur d'une macro si le classeur actif est
protégé.

Merci d'avance


Avatar
defluc
Merci beaucoup
FS a écrit :
Bonjour,

Par exemple :

'======================= > Function IsProtected(Wbk As Workbook) As Boolean
Dim x
With Wbk
x = .ProtectStructure + .ProtectWindows
End With
IsProtected = (x < 0)
End Function
'======================= >
FS