Free Support Forum - aspose.com

Workbook.CalculateFormula generates !Value excel sheet displays correct

Hi

We have recently upgraded our Aspose version from 7.5 to 18.5.1. As a result the newest version is incorrectly return the result when using:

var value = sheet.CalculateFormula(sheet.Cells[6, 21].Formula);

When looking at the sheet the formula parsed is correctly executed, however from a .net side the value is not calculated.

Attached is the spreadsheet in question. AsposeTestSheet_20180821.zip (13.5 KB)

@jonogeorge,

We were able to observe the issue but we need to look into it more. We have logged the issue in our database for investigation and for a fix. Once, we will have some news for you, we will update you in this topic.

This issue has been logged as

CELLSNET-46302-Worksheet.CalculateFormula() does not return calculated value

@jonogeorge,

We have investigated the issue thoroughly and observed that when the formula’s calculated result refers to a reference, we return the reference itself(ReferredArea object) instead of one single value in the reference. So you need to check the type of the return result, if it is ReferredArea, user may get any cell value in the reference by apis of ReferredArea object. Hence it is not an error in the API but the expected behavior of the API. Please feel free to provide your feedback.