I have the following code in the macro. It was written by the Macro Wizard, but the macro errors out when it gets to this point. Why is it erroring out?
ActiveSheet.Protection.AllowEditRanges.Add Title:="Range1", Range:=Range("L11:P65536")
ActiveSheet.Protection.AllowEditRanges.Add Title:="Range2", Range:=Range("U11:Z65536")
ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True _
, AllowFormattingCells:=True, AllowFormattingColumns:=True, _
AllowFormattingRows:=True, AllowInsertingRows:=True, AllowDeletingRows:= _
True, AllowFiltering:=True