This code must go in the Worksheet's code page
Private Sub Worksheet_Activate()
ActiveSheet.Protect contents:=False
ActiveSheet .CheckBoxes.Value = False
'Do other code here
ActiveSheet .Protect contents:=True, userinterfaceonly:=True
End Sub
Or use this code, which must be in the ThisWorkbook Code page
Private Sub Workbook_SheetActivate(ByVal Sht As Object)
'If statement prevents code from running on wrong sheets.
If Sht.Name = "Name of desired Sheet" Then 'Modify to suit
With Sht
.Protect contents:=False
.CheckBoxes.Value = False
'Do other code here
.Protect contents:=True, userinterfaceonly:=True
End With
End If
End Sub