Unlocked Combo Box displays protection error when clicked

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

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
 

Excel Facts

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.
I've now resolved this.

All Combo Boxes have a Linked Cell. This cell was locked and was therefore causing the error.
 
Upvote 0

Forum statistics

Threads
1,220,965
Messages
6,157,119
Members
451,398
Latest member
rjsteward

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top