I am creating a for loop to check if the cells are empty for an excel sheet, the error message I am getting is
An unhandled exception of type 'Microsoft.CSharp.RuntimeBinder.RuntimeBinderException' occurred in Unknown Module. Additional information: Cannot convert null to 'bool' because it is a non-nullable value type.
I tried converting to string as suggested in another thread, but I am unlucky with it.
I am using Microsoft Excel 12.0 Object Library.
Here is my code:
for (int i = 1; i < 55555; i++)
{
if (xlWorkSheet.Cells[i, 1] = null)
{
//////Write data into the cell
}
else
{
//// i++;
}
}