Posted 1 June 2022, 12:55 am EST
Hi,
I’m using Spread.NET to load in backgroup an Excel file and using it for various reasons.
I need to check if a specific cell is:
- an error (DIV/0, NAME, REFERENCE…)
- a numeric value
- a logical value
For error, I’ve tried with the IsErrFunctionInfo but it always returns false
workbookSet = GrapeCity.Spreadsheet.Win.Factory.CreateWorkbookSet();
GrapeCity.Spreadsheet.IWorkbook workbook = workbookSet.Workbooks.Open(@"excelFile.xlsx");
GrapeCity.Spreadsheet.IRange test = workbook.Worksheets[1].Cells[25, 9];
FarPoint.CalcEngine.IsErrFunctionInfo isErrFunctionInfo = new FarPoint.CalcEngine.IsErrFunctionInfo();
object[] parameters = new object[1];
parameters[0] = test.Value;
var test2 = isErrFunctionInfo.Evaluate(parameters);
Is there a way to cast a cell value to match with this enum GrapeCity.CalcEngine.CellValueType ?
Thanks