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

Free Support Forum - aspose.com

Saved Named range row read back Mod 64K (as a short int?)

Using aspose.cells for .net V4.9.1.13 - I am saving a wroksheet as a .XLSX (Excel07) format with a named range that is on a row > 65535, specifically row 140461, Reading the spreadsheet back (either in Excel or in Aspose), and accessing the same named range yields starting row = 9389, which happens to be my actual starting row less 2 x 65536, which leads me to believe that somewhere down the road named range is saved as a 16bit integer rather than a 32bit int.

Hi,

Could you try the attached latest version/fix v5.1.2.3. If you still find the issue, kindly give us your sample file(s) and test code (with all the details) to reproduce the issue.

We will check your issue soon.

Thank you.

The problem is still there in this version. I can’t send you the exact code, we have much custom stuff. But the function could be simulated as below, just create a sheet with over 128K rows, create a named range, then save in an XLSX file using Aspose. Then open the file using Excel2007 and check where the named range points to.

private static string CreateFile(string filename)
{
int sheetNumber = 0;
Aspose.Cells.Workbook excel = new Workbook ();
for (int tableRow = 0; tableRow < 150000; tableRow++)
excel.Worksheets[sheetNumber].Cells[tableRow, 0].PutValue(tableRow.ToString());

// put range on the last row
Range range = excel.Worksheets[sheetNumber].Cells.CreateRange(tableRow-1, 1, 1, 1);
range.Name = “TEST RANGE”;

excel.Save(filename, FileFormatType.Excel2007Xlsx);
}

Hi,

Thanks for your sample code.

I have found the issue after an initial test, we will figure it out soon.

Your issue has been logged into our issue tracking system with an id: CELLSNET-19588.

Thank you.

Hi Garrick,

Please set the file format of the constructing workbook. The default format is Excel 97 -2003. Following code snippet will help.

Aspose.Cells.Workbook excel = new Workbook(FileFormatType.Xlsx);
int tableRow = 150000;
Range range = excel.Worksheets[0].Cells.CreateRange(tableRow - 1, 1, 1, 1);
range.Name = "TESTRANGE";
excel.Save(@"F:\FileTemp\dest.xlsx");

1 more thing to be noticed that MS Excel do not allow spaces in the Named Range.

Thanks,