title: Powershell setting Excel cell value where Data Validation is ON
body: <p>I have a protected spreadsheet with some cells having Data Validation ON. I want to write legal values to these cells using Powershell.</p>
  
  <p>Attempting saomething like:</p>
  
  <pre><code>$Worksheet.Item($col,$row)=$value
  </code></pre>
  
  <p>Always returns:</p>
  
  <blockquote>
    <p>Exception setting "Item": "The cell or chart that you are trying to change is protected and therefore read-only.</p>
    
    <p>To modify a protected cell or chart, first remove protection using the
    Unprotect Sheet command (Review tab, Changes group). You may be
    prompted for a password." At H:\scripts\ecmTrack_Shell.ps1:81 char:27
    +         $WSheet.Cells.Item &lt;&lt;&lt;&lt; ($col,$row)=$value
        + CategoryInfo          : NotSpecified: (:) [], SetValueInvocationException
        + FullyQualifiedErrorId : CatchFromBaseAdapterParameterizedPropertySetValueTI</p>
  </blockquote>
  
  <p>Found similar issue being addressed at <a href="https://stackoverflow.com/questions/11979055/use-vba-to-change-value-of-cell-with-data-validation-applied">Use VBA to change value of cell with data validation applied</a>, but don't see how this approach can apply to PShell since no types are being declared.</p>
  
  <p>Any help greatly appreciated!</p>