DeleteColumn rewrites structured references to the wrong column

Hi,

When I delete a table column with Cells.DeleteColumn, structured references to that column
in other formulas get silently re-pointed to the neighbouring column instead of becoming
#REF! the way Excel does. The formula keeps calculating but now returns the wrong column.

Short repro:

var wb = new Workbook();
var ws = wb.Worksheets[0];
ws.Cells["A1"].PutValue("Name"); ws.Cells["B1"].PutValue("Email"); ws.Cells["C1"].PutValue("Phone");
ws.Cells["A2"].PutValue("Bob");  ws.Cells["B2"].PutValue("bob@x.com"); ws.Cells["C2"].PutValue("222");
ws.ListObjects[ws.ListObjects.Add(0, 0, 1, 2, true)].DisplayName = "myTable";

var f = wb.Worksheets.Add("Report");
f.Cells["A1"].Formula = "=XLOOKUP(\"Bob\",myTable[Name],myTable[Email])";
Console.WriteLine(f.Cells["A1"].Formula);   // =XLOOKUP("Bob",myTable[Name],myTable[Email])

ws.Cells.DeleteColumn(1);                    // delete the "Email" column
Console.WriteLine(f.Cells["A1"].Formula);   // =XLOOKUP("Bob",myTable[Name],myTable[Phone])  <-- wrong

Expected: after deleting Email, the reference should become #REF!, not shift to myTable[Phone].

The same happens with current-row references ([@[Column]]): a Result column formula
=IF([@Key]="",[@Alpha],[@Alpha]-[@Beta]) becomes =IF([@Key]="",[@Beta],[@Beta]-[@Beta])
after deleting the Alpha column, and with InsertCutCells when moving a column.

Could you confirm whether this is a bug and whether a fix is planned? Thanks!

@ronald.g

Hi,

Thank you for providing the code snippet to demonstrate this behavior.

I have successfully reproduced the issue using Aspose version 26.6. My testing confirms that when a table column is deleted via DeleteColumn, structured references in formulas are incorrectly shifting to the neighboring column instead of returning a #REF! error as expected in Excel. This occurs for both absolute table references and current-row references.

We have confirmed this is a bug. We release a new version of Aspose.Cells every month, typically during the first half of the month. Since the current version is 26.6, the fix will be included in the upcoming 26.7 release.

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-60371

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.

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