Hi, I’ve noticed an issue that occurs when deleting columns in a worksheet with cells that contain references to a table in that worksheet.
When the columns are deleted, any cell formulas that reference that table are changed to #REF and no longer evaluate. This was working in 20.7 but seems to result in #REF errors in 22.7 and 22.11. Deleting rows seems to work just fine.
Below is a minimal version of the code that replicates the issue in the affected versions. The expected output is that the second Assert should succeed and, if the workbook is saved/opened, the columns should be deleted and the cell with a table reference in its formula should be unchanged.
var wb = new Aspose.Cells.Workbook();
var ws = wb.Worksheets.First();
//Create a 2x2 table at F1:G2
ws.Cells[0, 5].PutValue("Column A");
ws.Cells[0, 6].PutValue("Column B");
ws.Cells[1, 5].PutValue("1");
ws.Cells[1, 6].PutValue("2");
var tableIdx = ws.ListObjects.Add(0, 5, 1, 6, true);
var tableDef = ws.ListObjects[tableIdx];
//create a reference to the table prior to deleting columns
ws.Cells[0, 7].Formula = $"=SUM({tableDef.DisplayName}[Column A])";
Assert.AreEqual($"=SUM({tableDef.DisplayName}[Column A])", ws.Cells[0, 7].Formula);
//Delete prior columns
ws.Cells.DeleteColumns(0, 4, true);
//This part fails as of 22.7 and 22.11 - formula is replaced with #REF instead of maintaining the table reference
Assert.AreEqual($"=SUM({tableDef.DisplayName}[Column A])", ws.Cells[0, 3].Formula);