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

Free Support Forum - aspose.com

What do I need for CellRange to be recognized (Apose Cells)?

I need to define a range of cells using Aspose. I found the following example here

CellRange range = new CellRange(6, 1, 6, 4);

However, with these code:

using Aspose.Cells;
. . .
CellRange unitNameRange = locationWorksheet.Cells[1, 1, 1, 4];

...I get, "Cannot resolve symbol 'CellRange'"

Why not? What am I missing? The project has a reference to Aspose.Cells, Runtime Version 4.0.30319, Version 16.11.0.0

Hi,


Thanks for providing us some details.

Well, your code segment is not right. Actually you are using CellRange class which resides in Aspose.Cells.GridDesktop control’s APIs (Aspose.Cells.GridDesktop is a windows based (desktop) independent .NET grid control which is used to simply display, manipulate or save/re-save an Excel file in WYSIWYG (visual) manner there are some other useful features which are supported too, see the docs for your further reference on the desktop based grid control). You should be using Range object and use Worksheet.Cells.CreateRange() method instead for your needs. I would recommend you to kindly see and browse the following documents/articles (under Aspose.Cells library Docs) on named ranges for your complete reference:
http://www.aspose.com/docs/display/cellsnet/Create+Access+and+Copy+Named+Ranges
http://www.aspose.com/docs/display/cellsnet/Format+and+Modify+Named+Ranges
http://www.aspose.com/docs/display/cellsnet/Setting+Formula+for+Named+Range

Hope, this helps a bit.

Thank you.