Hi,
I have a simple console application where I want to test how TEXTSPLIT works but it doesn't give me the values of the cells. Can anyone tell me what I'm doing wrong?
Here is the code
using Syncfusion.XlsIO;
using (ExcelEngine excelEngine = new ExcelEngine())
{
//Initialize application
IApplication app = excelEngine.Excel;
app.EnableIncrementalFormula = true;
//Set default application version as Xlsx
app.DefaultVersion = ExcelVersion.Xlsx;
//Open existing Excel workbook from the specified location
string inputFileName = @"url";
Stream fileStream = File.OpenRead(inputFileName);
IWorkbook workbook = app.Workbooks.Open(fileStream);
workbook.SetSeparators(';', ',');
workbook.CalculationOptions.CalculationMode = ExcelCalculationMode.Automatic;
IWorksheet worksheet = workbook.Worksheets[0];
worksheet.EnableSheetCalculations();
worksheet["A1"].Text = "Excel|Test";
Console.WriteLine(worksheet["A2"].CalculatedValue);
Console.WriteLine(worksheet["A2"].DisplayText);
Console.WriteLine(worksheet["A3"].CalculatedValue);
Console.WriteLine(worksheet["A3"].DisplayText);
worksheet.DisableSheetCalculations();
}
Result:
#NAME?
#VALUE!
Hi Jordan,
Please refer to the attached sample for how text split works using XlsIO.
Regards,
kurmitha M.
Hi,
Thanks for your reply.
What I'm actually trying to achieve is when I added a value in a cell like in cell A1 in the example that cell A2 reacts to this because in cell A2 there is a TEXTSPLIT function. Is this something that is working?
See attached excel.
Kind regards,
Jordan
Hi Jordan,
Please refer to the modified sample where the Excel file loads with text split occurring in cell A2, and entering a value in cell A1, the cell updates accordingly.
Also, XlsIO currently does not have calculate support for TEXTSPLIT formula. We have logged this as a feature "Calculate support for TEXTSPLIT formula in XlsIO " request. We will implement this feature in one of our upcoming releases.
You can track the status of the feature through the feedback link.
Regards,
Kurmitha M.
Hi,
Thanks for your answer. Where can I find a list of formulas that supports calculation? We actually use the library to calculate values based upon a configured excel file so it's important for us to know which formulas can be used.
Thanks,
Kind regards,
Jordan
Hi Jordan,
Please refer to the attached Excel file for unsupported calculate values in XlsIO. We will document this in near future.
Regards,
Kurmitha M.