I have a spreadsheet which uses code to add multi-select ListBoxes containing data from a named range. Selections from this list are then output to the selected cell.
Only when I protect the sheet to I get a runtime error 1004: unable to get the add property of the listboxes class and therefore the ListBoxes cannot be added.
The selectedCell however is unlocked.
How can I prevent deletion of data and formulas while allowing ListBoxes to be created?
Part of the code is as follows:
Public Sub CreateCatPopUp(ByRef selectedCell As Range)
Set catSelectCell = selectedCell
Dim CatPopUpCell As Range
Set CatPopUpCell = catSelectCell.Offset(1, 0)
Const CAT_POPUP_HEIGHT As Double = 300
Dim catBox As ListBox
Set catBox = ActiveSheet.ListBoxes.Add(CatPopUpCell.Left, _
CatPopUpCell.Top, _
ActiveCell.Width, _
CAT_POPUP_HEIGHT)