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