I'm working with a project where I use interop to work with Excel. I have a full Worksheet and I would like to know how can I get the name cell, for example, B15.
I'm trying to do it with this:
for (int j = 0; j < RowsCount; j++)
{
for (int i = 0; i < ColumnsCount; i++)
{
object cellValue = rng.Value;
System.Diagnostics.Debug.WriteLine("*****value is: " + cellValue.ToString());
}
}
But doesn't work. I'm new with interop and I am trying to find good tutorials but can't find a good one. At the end, what I want to do is introduce formulas in some cells. For that reason, I need to know the actual cell and the limits of the Excel, the last row and column.
To know the last row or column, Can I know it with the worksheet or have I know it with the datatable used to create the actual worksheet?