title: C# Excel protected sheet
body: <p>I am using c# to do some automation with Excel. I compile the data and create a table around it so that a user can calculate the sum of a column. Everytime I protect the sheet, no matter which options I turn true or false, I can never gain access to that feature again. Is there a  way to do it?</p>
  
  <p>here is the relevant function definition from Microsoft <a href="https://msdn.microsoft.com/en-us/library/office/ff840611.aspx" rel="nofollow">https://msdn.microsoft.com/en-us/library/office/ff840611.aspx</a></p>
  
  <p>a snippet of relevant code</p>
  
  <pre><code>warrantySheet.Cells.Locked = false;
  getWarrantySheetUsedRange().Locked = true;
  warrantySheet.Protect(SHEET_PASSWORD,true, true, true,true, true, true, true,false, false,false,false,false, true,true,true);
  </code></pre>
  
  <p>here is the imgur for what I am talking about  <a href="http://imgur.com/TXjDXdt" rel="nofollow">http://imgur.com/TXjDXdt</a></p>