Hello,
I have a program which accepts an excel formula from the user and pastes the result in a designated excel file. When using TODAY() formula the CalculateFormula function returns a numeric value and not a date. This is my code:
public void SetCellValue(int row, int column, string formula, Worksheet worksheet)
{
var result = worksheet.CalculateFormula("=" + formula);
worksheet.Cells[row, column].PutValue(result.ToString(), true, true);
}
Is there a way to automatically detect the correct format of a formula result and return it in this format?(for example a numeric format for a SUM function and a date format for TODAY() function)
I’m using Aspose for .Net, version 20.7.
Thanks!