Aspose breaks cell references in formulas after cut and insert

Hi Team,

We were planning to use the new version of Aspose (23.8), but we noticed that our tests are failing. After some investigation, I found that InsertCutCells changes the formulas and the its cell address references. I believe this is due to a change in Aspose.cells 23.6, probably this one :

CELLSNET-53406	InsertCutCells - Cutting rows and then inserting them somewhere else does not maintain formula references	Bug

Here is what happens along with a test scenario. I have a Mode!E1 and it’s formula is : =SUM(E6,E7 ,E8)
if I cut the Row 1 and insert it in row 9, it’ll still keep the same formula (i.e. SUM(E6,E7,E8)), but if I do the same thing with Aspose, the Formula changes to =SUM(E13,E14,E15) !
NOTE: I’ve defined a name for the entire row 1 and get the range using the row name.

This is my code :

    var model = workbook.Worksheets["Model"];

    var stockPriceRow = workbook.Worksheets.Names["MO_VA_StockPrice_TradingCurrency"];
    var sourceRange = workbook.Worksheets.GetRangeByName(stockPriceRow.FullText);
    var destinationRange = workbook.Worksheets["Model"].Cells.CreateRange("9:9");

    model.Cells.InsertCutCells(sourceRange, destinationRange.FirstRow, destinationRange.FirstColumn, ShiftType.Down);

    var calculationOptions = new CalculationOptions { IgnoreError = true };
    workbook.CalculateFormula(calculationOptions);
    workbook.save("Path");

This is my test workbook. FormulaTestAspose.zip (6.4 KB)

Thank you

@yashar.heydari
By using sample file and code for testing, we can reproduce the issue. It was found that formula reference error after calling the Cells.InsertCutCells method.
We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): CELLSNET-54113

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.

@yashar.heydari,

This is to inform you that your issue has been resolved. This fix will be included in our upcoming release (Aspose.Cells v23.9), scheduled for release this week or next week. You will be notified when new version is released.

1 Like

The issues you have found earlier (filed as CELLSNET-54113) have been fixed in this update. This message was posted using Bugs notification tool by johnson.shi