0
votes

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 this 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

2

2 Answers

1
votes

Yes, you got it right. Actually you were using CellRange class which resides in Aspose.Cells.GridDesktop control's APIs (Aspose.Cells.GridDesktop is an independent windows based (desktop) .NET grid control which is used to simply display, manipulate or save/re-save Excel files in WYSIWYG (visual) manner there are some other useful features which are supported too). You should be using Range object and use Worksheet.Cells.CreateRange() method instead for your needs.

I am working as Support developer/ Evangelist at Aspose.

0
votes

From here:

...I see that that other link was misleading (used for a different purpose/in different circumstances); this is the way to do it:

Range unitNameRange = locationWorksheet.Cells.CreateRange("A1", "A4");