Posted 4 November 2021, 4:00 pm EST
Hi,
We just encountered a weird behavior regarding getting value from cell using formula TEXT. Please refer attachment for reproduction.
If we get the cell value of A1 from test file [CPSETC.xlsx] using the following code, we can get the correct value FY16.APR. But if we new workbook with EnableCalcuation = false, the value will be FY20160405!/00!/01.APR which is incorrect even if we set EnableCalculation to true before getting the cell value.
We expect the behavior should be the same no matter EnableCalculation is true or false when creating new Workbook instance.
Please help to investigate this issue. Thank you.
Regards
var options = new XlsxOpenOptions {DoNotRecalculateAfterOpened = true};
var workbook1 = new Workbook {EnableCalculation = true};
// If we create new Workbook instance with EnableCalculation = false,
// result will be incorrect event we manually set EnableCalculation to true before getting value from range.
//var workbook1 = new Workbook {EnableCalculation = false};
workbook1.Open(@"..\..\..\CPSETC.xlsx", options);
workbook1.EnableCalculation = true;
var range = workbook1.Worksheets["SETC"].Range["A1"];
Console.WriteLine("Value:" + range.Value);
```[zip filename="gcexcelperformance.zip"]https://gccontent.blob.core.windows.net/forum-uploads/file-ab0ed2b1-c51e-40b1-909d-ce8c93e4ddc4.zip[/zip]