InsertCutCells wiping out invalid custom function names

When I use InsertCutCells to copy a range containing a formula with an invalid custom function name into a new workbook, the target cell which should correspond to that source cell has no formula. Here is my testing code and the output

using Aspose.Cells;

Workbook srcWorkbook = new(@"C:\Swift\Templates\Dev\Input_InterestRateEstimator.xlsx");

var srcRange = srcWorkbook.Worksheets.Names.First(
    n => n.Text.Equals("INTERESTRATEESTIMATOR", StringComparison.OrdinalIgnoreCase)).GetRange();

Workbook targetWbk = new();
var inputSheet = targetWbk.Worksheets.Insert(0, SheetType.Worksheet, "Input");

Console.WriteLine($"Source L61 formula: {srcRange[59, 11].Formula}");
inputSheet.Cells.InsertCutCells(srcRange, 7099, 0, ShiftType.None);

Console.WriteLine($"Target L7156 formula: {inputSheet.Cells["L7156"].Formula}");

Source L61 formula: =getIRE_DateInput(L57)
Target L7156 formula:

Input_InterestRateEstimator.zip (70.1 KB)

Please investigate ASAP in case there is a quick remedy for this and it can be included in the January release. Thank you!

@bytefyre

The InsertCutCells method in Aspose.Cells is not preserving formulas that contain invalid or unrecognized custom function names (e.g., =getIRE_DateInput(L57)) when copying a range from one workbook to another, resulting in the target cell having no formula after the operation . This behavior has been observed in your test case using Aspose.Cells 25.10, where the source cell correctly shows the formula but the destination cell ends up with an empty formula .

This issue appears to be related to a recently reported defect where InsertCutCells fails to preserve array formulas during copy operations, although your case specifically involves custom function names rather than array formulas [2, 3]. The similarity in behavior—values being transferred correctly while formulas are lost—suggests a broader regression in how InsertCutCells handles non-standard or unrecognized formula constructs.

There is also precedent for Aspose.Cells having issues with custom functions or macros in formulas. For example, issue CELLSJAVA-46034 involved removal of custom macros in formulas and was resolved in Aspose.Cells for Java v24.7 [4, 5]. While this was in the Java version, it indicates that such formula preservation problems have occurred before and were treated as fixable defects.

Given that similar issues have been prioritized and resolved in recent releases, it is reasonable to treat this as a potential regression that may be addressed in an upcoming release.

We will log this issue for immediate investigation. In the meantime, a possible workaround could be to manually copy the range using Copy instead of InsertCutCells, or to reassign formulas after insertion, though this may not be ideal for large or complex ranges.

We appreciate your report and will follow up as soon as more information is available.

@bytefyre
Cell L61 should correspond to Cell L7159 (59 + 7099 + 1 = 7159),not L7156. The formula of L7159 is =getIRE_DateInput(L7155).
It works fine.
Please check again, if you still any issue , please feel free to contact us.

Okay, my apologies about the cell location. I thought I had found a root cause to the actual issue I was investigating, but it turns out I was incorrect.

The overall issue is that a data validation associated through formulas with cell L7156 is not populating with the same dropdown value as in the source workbook. Here is adjusted code to reproduce the issue:

using Aspose.Cells;

Workbook srcWorkbook = new(@"C:\Swift\Templates\Dev\Input_InterestRateEstimator.xlsx");

var srcRange = srcWorkbook.Worksheets.Names.First(
    n => n.Text.Equals("INTERESTRATEESTIMATOR", StringComparison.OrdinalIgnoreCase)).GetRange();

Workbook targetWbk = new();
var inputSheet = targetWbk.Worksheets.Insert(0, SheetType.Worksheet, "Input");

var validationList = (object[])srcRange[48, 1].GetValidation().Value1;
Console.WriteLine($"Source B50 validation list length: {validationList.Length}");
inputSheet.Cells.InsertCutCells(srcRange, 7098, 0, ShiftType.None);

validationList = (object[])inputSheet.Cells["B7147"].GetValidation().Value1;
Console.WriteLine($"Target B7147 validation list length: {validationList.Length}");

Source B50 validation list length: 1
Target B7147 validation list length: 0

Please use the same workbook I’d sent previously. Thank you!

@bytefyre,

Thanks for providing further details and code snippet.

After initial testing, I am able to reproduce the issue as you mentioned by using your sample code with your template Excel file. I found InsertCutCells is wiping out invalid custom function names somehow.

We require thorough evaluation of the issue. 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-59668

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.

@bytefyre,

This is to inform you that your issue (Ticket ID: “CELLSNET-59668”) has been resolved. The fix/enhancement will be included in our upcoming release (Aspose.Cells v26.1) that we plan to release during the next week of January 2026. You will be notified when the next version is released.

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