How can I check if specific SpreadsheetGear IRange contains values (=Non-blank cells)?
In Excel, I could utilize COUNTA function but there is no such in SpreadsheetGear.
SpreadsheetGear does support the COUNTA function. You can input it as part of a formula directly into a cell. Or you can use the ISheet.EvaluateValue(...) method to evaluate a formula without actually entering it into a cell. Example:
// Count the number of non-empty cells in A1:A12 on the specified worksheet
double count = (double)worksheet.EvaluateValue("COUNTA(A1:A12)");
You could build your own count routine using SpreadsheeGear API as well. The code below might be a good starting-out point:
int counter = 0;
foreach (IRange cell in worksheet.Cells["A1:A12"])
{
if (cell.ValueType != SpreadsheetGear.ValueType.Empty)
counter++;
}