I have a stack of code running in a spreadsheet or two. The workbooks and sheets are protected but they are open to allow VBA to make changes. So far so good.

I have the following draft giving me problems though.
Sub Macro2()
'
' Macro2 Macro
'

'
    With ThisWorkbook.Worksheets("Sheet1").Range("b3").Validation
        .Delete
        .Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:= _
        xlBetween, Formula1:="Yes,No"
        .IgnoreBlank = True
        .InCellDropdown = True
        .InputTitle = ""
        .ErrorTitle = ""
        .InputMessage = ""
        .ErrorMessage = ""
        .ShowInput = False
        .ShowError = False
    End With
End Sub
Runs just fine when unlocked etc. But if it is locked up I get "Application-defined or object-defined error". What am I missing?