osianllwyd
New Member
- Joined
- Apr 20, 2012
- Messages
- 36
I have a Combo Box (Form Control, not ActiveX) which is Unlocked. When I protect the worksheet it returns this error when I click the box:
"The cell or chart you are trying to change is protected and therefore read-only.
To modify a protected cell or chart, first remove protection using the Unprotect Sheet command (review tab, Changes group). You may be prompted for a password."
The ComboBox does have a macro assigned to it when clicked, which displays a range of other objects. However I ensure that I unprotect the sheet at the beginning of this macro to ensure that there is no error. See code below.
Can anyone see why I'm getting the above error?
thanks
"The cell or chart you are trying to change is protected and therefore read-only.
To modify a protected cell or chart, first remove protection using the Unprotect Sheet command (review tab, Changes group). You may be prompted for a password."
The ComboBox does have a macro assigned to it when clicked, which displays a range of other objects. However I ensure that I unprotect the sheet at the beginning of this macro to ensure that there is no error. See code below.
Can anyone see why I'm getting the above error?
thanks
Code:
Sub Hide_F2_Items()
ActiveSheet.Unprotect
If UserInput.Shapes("F2_Dates_Interface").Visible = msoTrue Then
UserInput.Shapes("F2_Dates_Interface").Visible = msoFalse
UserInput.Shapes("Dates_Arrow").Visible = msoFalse
UserInput.Shapes("F2_Go").Visible = msoFalse
UserInput.Days1.Visible = False
UserInput.Days2.Visible = False
UserInput.MonthYear1.Visible = False
UserInput.MonthYear2.Visible = False
End If
ActiveSheet.Protect
End Sub