title: Concurrent Reads and Write to an Excel file
body: <p>Is it possible to have only one process do WRITE and many doing a READ operation on an excel file? I am using ExcelPackage(EPPlus) for this. </p>
  
  <p>To demo, I wrote two console app one to write iteratively and another to read. Running them concurrently will cause a failure on either side.</p>
  
  <p><strong>WRITE</strong></p>
  
  <pre><code>// simply write to a column
  var fileLocation = "D:\\Book.xlsx";
  FileInfo fi = new FileInfo(fileLocation);
  
  int i = 1;
  while (1 == 1)  //ALERT: an infinite loop!
  {
      using (ExcelPackage excelPackage = new ExcelPackage(fi))
      {
          ExcelWorksheet worksheet = excelPackage.Workbook.Worksheets["Sheet1"];
          var row = worksheet.Row(2);
  
          worksheet.Cells[$"A{i}"].Value = "Test " + i.ToString();
          excelPackage.Save();
          i++;
      }
  }
  </code></pre>
  
  <p><strong>READ</strong></p>
  
  <pre><code>//simply populate a list reading excel
  var fileLocation = "D:\\Book.xlsx";
  FileInfo fi = new FileInfo(fileLocation);
  List&lt;string&gt; list = new List&lt;string&gt;();
  ExcelWorksheet worksheet = null;
  int i = 1;
  while (1 == 1)  //ALERT: an infinite loop!
  {
      using (ExcelPackage excelPackage = new ExcelPackage(fi))
      {
          worksheet = excelPackage.Workbook.Worksheets["Sheet1"];
          if (worksheet.Cells[i, 1].Value != null)
          {
              list.Add(worksheet.Cells[i, 1].Value.ToString());
          }
      }
  
      list.Clear();
  }
  </code></pre>