We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Named range and SortNames issue


You made a fix a few days ago about an issue concerning the function "SortNames" (post #104342, fix: Aspose.cells.dll v4.4.0.20). But I have detect a new issue with this function. I attach two workbooks, "source" and "result" in order to explain the issue.
In the source workbook there are named ranges wich are used in some formulas. I open the source workbook, then I add some named ranges, and after I use SortNames and I save the workbook.
This is the sample code:
Workbook workbook;
workbook = new Workbook();

Worksheet worksheet = workbook.Worksheets[worksheet_codename];

Cell cell1 = worksheet.Cells[2, 6];
Range range1 = worksheet.Cells.CreateRange(cell1.Row, cell1.Column, 1, 1);
range1.Name = "ASCell1";

Cell cell2 = worksheet.Cells[1, 6];
Range range2 = worksheet.Cells.CreateRange(cell2.Row, cell2.Column, 1, 1);
range2.Name = "ASCell2";


When I check the workbook in excel, I notice that in worksheet 2, column D there are mistakes in some formulas which use named ranges. There is a shift in the named ranges (cells D5:D8 are good, cells D9:D14 are wrong).

The workbook named "source" shows the workbook before the operation, and the workbook "result" shows the workbook after the sample code is played.

Please, can you fix this issue, it is very important for us.

Thank you,


Hi Gregory,

Thanks for the source and result files.

We checked and found the issue with Worksheets.SortNames method.

We will fix the issue soon.

Thank you.

Please try this attached fix.