title: Enable editing on protected excel file
body: <p>I am trying to edit excel file (.xlsx) using closedXML. It throws exception after i edit and save it which says {&quot;An item with the same key has already been added. Key: B2501&quot;}. I don't have any other instance opened of excel workbook open.</p>
  <p>I am guessing it might be because its protected file i am unable to Save or Save As.</p>
  <p>Does anyone have any insight on how to fix this. Any help would be appreciated.</p>
  <pre><code>  public void deleteUnusedRowFromExcel(string filePath, string sheetName, string strfileName)
      {
          int rowCount = 0;
          using (XLWorkbook wb = new XLWorkbook(filePath))
          {
              IXLWorksheet xLWorksheet;
              if (sheetName != &quot;&quot;)
              {
                  xLWorksheet = wb.Worksheet(sheetName);
              }
              else
              {
                  xLWorksheet = wb.Worksheet(1);
              }
              rowCount = xLWorksheet.RowsUsed().Count() == 0 ? 0 : xLWorksheet.RowsUsed().Count() - 1;
  
            
              foreach (IXLRow row in xLWorksheet.RowsUsed())
              {
                  string ab = row.Cell(2).GetString();
                  if (row.Cell(2).GetString() == &quot;&quot;)
                  {
                      row.Delete();
                      break;
                  }
              }
              wb.SaveAs(strfileName);
  
          }
      }
  </code></pre>