Hi Team,
Here is the usage scenario I use Aspose.Cells.GridDesktop.GridDesktop control and Aspose.Cells.Workbook class in my project.
1. Create a GridDesktop control for user to input the data.
2. Save the data as Stream using GridDesktop.ExportExcelFile() method.
3. Create a Workbook instance by the saved Stream to read to data.
But I met a problem to get the correct value from Workbook instance.
For example, input number “1” in cell A1, then input a formula “=IF(A1=1,10,0)” in cell A2, input a formula “=IF(A1=“1”,10,0)” in cell A3.
In the GridDesktop control, I get the some result “10” from cell A2 and A3.
But when I try to get the data from Workbook instance, I get the different results “10” from A2 and “0” from A3.
Here are the example codes:
gridDesktop.Worksheets[0].Cells[0,0].Value = 1;
gridDesktop.Worksheets[0].Cells[0,1].Value = “=IF(A1=1,10,0)”;
gridDesktop.Worksheets[0].Cells[0,2].Value = “=IF(A1=“1”,10,0)”;
gridDesktop.RunAllFormulas();
Console.WriteLine("A2 Cell Value: " + gridDesktop.Worksheets[0].Cells[0,1].Value);
Console.WriteLine("A3 Cell Value: " + gridDesktop.Worksheets[0].Cells[0,2].Value);
MemoryStream ms = new MemoryStream();
gridDesktop.ExportExcelFile(ms);
Workbook wb = new Workbook(ms);
wb.CalculateFormula();
Console.WriteLine("A2 Cell Value: " + wb.Worksheets[0].Cells[0,1].DoubleValue);
Console.WriteLine("A3 Cell Value: " + wb.Worksheets[0].Cells[0,2].DoubleValue);
Is there any solution to help me to get the same result from Workbook instance as GridDesktop control?
Thanks.