Extra-wide Named Ranges saved incorrectly

I’m adding a named range to a spreadsheet that is rather long and on a single row.

It spans far enough that the column name notation spreads into 3 letters, e.g. 'ANX2’

The test range I’m trying to add, using the Worksheet.Cells.CreateRange method, is ‘A2:ANX2’.

I give it the name ‘Test’.

Once I’ve saved the Workbook and loaded it up in Excel, I go to Name Manager and find my named range called ‘Test’. Its reference range is ‘A2:AN2’. It appears that the ‘X’ has been dropped.

Is this a limitation of Aspose.Cells?

I’m using Aspose.Cells.dll 7.0.0.4

Hi,


Please specify while creating the new Workbook that you are going to create XLSX file format via its constructor. I am using the following code and it works fine, see the first line of code.

Sample code:

Workbook workbook = new Workbook(FileFormatType.Xlsx);
var range = workbook.Worksheets[0].Cells.CreateRange(“A2”, “ANX2”);

range.Name = “test”;

workbook.Save(“e:\test2\Testingnamedanx.xlsx”);

Ahhhhhh… thank you!

Hi,

Thanks for your feedback.

Aspose.Cells by default creates workbook in Xls (Excel 2003) format unless you explicitly tells it to create the Xlsx (Excel 2007/2010) format via the same code as shared above.

Besides, you can create a workbook of your required format by loading the empty template file. Suppose, your template file is xlsx, then workbook will be created in xlsx format by default.