I didn't trace through the whole thing, but I think that the sheet lunie is always protected
[OVT Locked] protects the entire sheet, including col H
[OVT Unlocked] protects the entire sheet, except col H
So "ActiveSheet.ProtectContents" is always true
It might be better to just test if Col H is locked instead: "ActiveSheet.range("H:H").locked"
I didn't understand the L1 part
Code:
'Callback for customButton1 getPressed
Public Sub UpOrDown(Control As IRibbonControl, ByRef returnedVal)
'If ActiveSheet.Range("L1") = "Yes" Then
' returnedVal = Not ActiveSheet.ProtectContents
' Exit Sub
'End If
Select Case Control.ID
Case "tbLocked"
returnedVal = ActiveSheet.Range("H:H").Locked
Case "tbUnlocked"
returnedVal = Not ActiveSheet.Range("H:H").Locked
End Select
End Sub