title: Run-Time-Error 1004 when adding Data Validation
body: <p>I am currently trying to add a Dropdown-List in a protected document.</p>
  
  <p>The code I am using is: </p>
  
  <pre><code>Private Sub AddDropDown_Click()
      ActiveSheet.Unprotect
  
      Dim currCell As Range
      Dim lastRow As Long
      With ActiveSheet
          lastRow = ActiveSheet.Cells(1048576, 1).End(xlUp).Row
      End With
      For Each currCell In Range("K4:K" &amp; lastRow)
          With currCell.Validation
              .Delete
              .Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:=xlBetween, Formula1:="=INDIREKT(J" &amp; currCell.Row &amp; ")"
              .IgnoreBlank = True
              .InCellDropdown = True
              .InputTitle = ""
              .ErrorTitle = ""
              .InputMessage = ""
              .ErrorMessage = ""
              .ShowInput = True
              .ShowError = True
          End With
      Next currCell
      ActiveSheet.Protect
  End Sub
  </code></pre>
  
  <p>But when I try to run the code it throws an Error 1004 in the row the .Add is excecuted.</p>
  
  <p>Most of the parameters throw the same Error when I try whatching them while debugging:</p>
  
  <p><a href="https://i.stack.imgur.com/v3XSR.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/v3XSR.png" alt="Debug Screenshot Validation"></a></p>
  
  <p>Does anyone have an idea what causes this?</p>