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:
for (int i = 1; i <= 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++;
...
}
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.