Formulas calculation across sheets

I have a multiple-sheet template Excel with formulas which are populated with data programatically. The formulas work across sheets, and sometimes are refering to other calculated fields. In Excel itself everything works fine, but when I run try to get the calculated cells programatically (after Workbook.CalculateFormula) calculations are done only within the sheet, those across-sheets, nested are not calculated. Is there some limitation ?

The reason is to re-use the template, which is very complex, just to dump the data there, let it calculate and then to read results programatically and use them further.

Thanks!


This message was posted using Page2Forum from Formula Calculation Engine - Aspose.Cells for .NET

Hi,

Could you try our latest version Aspose.Cells for .NET v5.3.2.6.

If you still find the issue, kindly do post your sample template file and paste your code to give more details where the issue occurs, we will check your issue soon.

Thank you.

I tried the latest version, still a problem. the Excel file + description - sent to your email - also attached here.

The steps: just loaded the file and run the CalculateFormula method and tried to read "Sheet B"!C6 - zero in the code.

Thanks - please let me know - it seems more users have the same issue!

Hi,

Thanks for reporting this to us.

We are able to reproduce your said issue using the latest fix version of Aspose.Cells for .Net v5.3.2.7. We have logged this issue under Ticket ID CELLSNET-26984. We will fix this very soon and update you here.

Sample C# code is as below,

var workbook = new Aspose.Cells.Workbook("D:\\aspose\\work area\\sample2.xls");
workbook.CalculateFormula();
var cells = workbook.Worksheets["Sheet B"].Cells;
Console.WriteLine(cells["C6"].Value);
Console.ReadKey();

thanks - I also copied over the Sheet B formulas into the same sheet - Sheet A - still doesn’t work

Hi,

Could you change your data in the file?

Please convert some string value in the range G9:I16 of the “Sheet A” to number value.

For example: select Cell G9, then enter, the left-top Triangle will be removed.

Then we can calculate a correct value.

Thank you, it helped! :slight_smile:

The issues you have found earlier (filed as 26984) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.