I am trying to delete a drop down from a spreadsheet using the following code:
Dim objShape As Shape
For Each objShape In ActiveSheet.Shapes
objShape.Delete
Next
But objShape
returns Application-Defined or Object-Defined Error
:
Debug.Print objShape.FormControlType
returns xlDropDown
Debug.Print objShape.Name
returns "Drop Down 250"
Debug.Print objShape.TopLeftCell
returns Application-Defined or Object-Defined Error
ActiveSheet.Cells.Validation.Delete
does not get rid of it, nor does using ShapeRange
.
Any suggestions on how to eradicate this little bugger would be greatly appreciated.