title: Saving to xlsx file in C#
body: <p>I am trying to read around 50K files in a folder, extract some details from each file and write to an excel file. I am using the below code:-</p>
  
  <pre><code>string savLoc = textBox2.Text.Trim();
  savLoc = savLoc + "\\Visible_Fields.xlsx";
  xlWorkBook.SaveAs(savLoc, Excel.XlFileFormat.xlWorkbookNormal, misValue, misValue, misValue, misValue, Excel.XlSaveAsAccessMode.xlNoChange, misValue, misValue, misValue, misValue, misValue);
  xlApp.DisplayAlerts = true;
  xlWorkBook.Close(true, misValue, misValue);
  xlApp.Quit();
  </code></pre>
  
  <p>But the xlsx file created is not openeing and showing its corrupted. But if I use extension as xls, it will work but xls is having a limitation of 65K in one worksheet. Can anyone tell me how this can be done? I can use only excel interop not any other free libraries. </p>
  
  <p>I use the interop version 14</p>