We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Calculate formula error

hi,

I assume CalculateFormula gets a wrong result. I’ve attached a sample excel file, that shows the error.

1. TestCase: Look at the cell B7, it contains “=ROUND(SUM(B1:B6);2)” and it works fine within excel.

2. TestCase: Use the file, open it and run the following code:

file.CalculateFormula();

foreach(int sheetIndex in sheets)
{
Aspose.Cells.Worksheet sheet = file.Worksheets[sheetIndex];
for(int row = sheet.Cells.MinRow; row <= sheet.Cells.MaxRow; row++)
{
for(int col = sheet.Cells.MinColumn; col <= sheet.Cells.MaxColumn; col++)
{
if (sheet.Cells[row, col].IsFormula == true)
{
object value = sheet.Cells[row, col].Value;
sheet.Cells[row, col].PutValue(value);
}
}
}
}

open the file and look at B7: it should contain: 564628437,36, but it contains -21474836,48.

Please help,
thanks Michael

Hi Michael,

Thanks for considering Aspsoe.

Thanks for pointing out. Yes, there is a problem with CalculateFormula() related to ROUND function. We will resolve the issue soon.

Thanks for your patience.

Regards

Amjad Sahi

Aspose Nanjing Team

Please try this attached fix.

Hi Laurence,

it worked fine. Thank you

Michael

similar problem with the following sheet.

Open the attached workbook, sheet ‘Bug reference’ and have a look at ‘AA50’.
If I run the same code (CalculateFormula), I find the value #Recursive Reference in it.

In other fields I get the value: Aspose.Cells.इ. Do you know that problem?

thanks in advance,
michael

Hi Michael,

Thanks for pointing it again, we will resolve it ASAP.

Regards

Amjad Sahi

Aspose Nanjing Team

Hi Michael,

Please try this fix.

About Aspose.Cells.इ value, could you give me more details if you still find it with this version?

Hi Laurence,

both errors are solved with the latest hotfix. Many thanks.

Michael

@Mischi,

Over the years, we have been enhancing Aspose.Cells’ formula calculation engine to make it more powerful and efficient. Now you can customize your re-calculations without any issue. The component can calculate huge list of formulas (in the spreadsheet) within no time. You may upgrade to newer Aspose.Cells versions and give it try to your diverse scenario.

You may browse Aspose.Cells Docs for your complete reference.