title: Excel Exception from HRESULT: 0x800A03EC when writing to a Excel cell
body: <p>I know that this has been discussed here, but I can not find solution.
  I am getting this error while working with Microsoft.Office.Interop.Excel in C# (Exception from HRESULT: 0x800A03EC).
  Here is my code:</p>
  
  <pre><code> for (int i = 1; i &lt;= max; i++)
   {
    int column = 1
    ...
    double averageDistance = sum / distanceCount;   //sum and distanceCount are type double
    myWorksheet1.Cells[i, column] = averageDistance;  // Here I am getting the exception. 
    column++;
    ...
   }
  </code></pre>
  
  <p>I know that some people solved this using non-zero based index in Cells[,], but as you can see my indexes are starting from 1. Can anyone help please?
  Thank you.</p>