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

Free Support Forum - aspose.com

Named ranges help

I apologize if this has been answered elsewhere, although I did a search and did not find what I was looking for.

I have an existing spreadsheet with quite a few named ranged defined. I was hoping that the Worksheet.Cells.Ranges collection would contain these ranges, but it returns an empty collection. Is there another way to access these defined name ranges?



Currently Aspose.Excel doesn’t automatically creates range based on names. Could you elaborate your need? Maybe we can find a work around.


No problem, I’m just going to define my ranges in the code, which will do for now.

Just a quick question, though, are there any drawing tools for drawing primitive shapes. For example, I would like to be able to create a colored circle in a cell range. I looked through the API but didn’t find anything resembling drawing tools, so I assume it is not in there. Just want to verify.

Thanks again!

Sorry, Aspose.Excel doesn’t supply this feature. Have you tried to create this drawing shapes in designer file and use Aspose.Excel to import them?


How would you import the drawing objects? I’m still learning the software, since yesterday was the first time I’ve delved into using it.

Just put the drawing objects in designer file and use Excel.Open method to import it.

Aspose.Excel is not available now as it is discarded and no more active development is done. A new product Aspose.Cells has replaced it which is much better in terms of range of features and support for the different versions of MS Excel. This new product also supports named ranges as shown in the following sample code:

// Instantiate a new Workbook.
Workbook workbook = new Workbook();

// Get the first worksheet in the workbook.
Worksheet worksheet1 = workbook.Worksheets[0];

// Create a range of cells based on H1:J4.
Range range = worksheet1.Cells.CreateRange("H1", "J4");

// Name the range.
range.Name = "MyRange";

// Input some data into cells in the range.
range[0, 0].PutValue("USA");
range[0, 1].PutValue("SA");
range[0, 2].PutValue("Israel");
range[1, 0].PutValue("UK");
range[1, 1].PutValue("AUS");
range[1, 2].PutValue("Canada");
range[2, 0].PutValue("France");
range[2, 1].PutValue("India");
range[2, 2].PutValue("Egypt");
range[3, 0].PutValue("China");
range[3, 1].PutValue("Philipine");
range[3, 2].PutValue("Brazil");

// Save the excel file.
workbook.Save(dataDir + "rangecells.out.xls");

Here is a link to the document where details are available about creating accessing and naming ranges:
Create Access and Copy Named Ranges

Here is the link to download the latest version of this product:
Aspose.Cells for .NET (Latest Version)

We have a complete runnable solution where all the features of this new product can be tested. Download the solution here.