Free Support Forum -

How to add named ranges to sheet and workbook without specifying range details?

Can I create a named range and add to sheet without using Range()? The demo I found has to specify the range to be referred, like below:

Workbook workbook = new Workbook();
Worksheet worksheet = workbook.getWorksheets().get(0);

range = worksheet.getCells().createRange(“B4”, “G14”);

Is there a way for us to do sth like:
Name name = new name() //don’t what is the constructor signature

Is that possible? Please let me know, thank you.


I think, may be you can try, see the following sample code with Aspose.Cells for Java API:
Sample code:

Workbook workbook = new Workbook();
Worksheet sheetRef = workbook.getWorksheets().get(0);
NameCollection names = workbook.getWorksheets().getNames();
String strName = "test";
Name name = names.get(names.add(strName));
//Make it invisible.

Thank you.

thank you, it works.


Thanks for your posting and using Aspose.Cells.

We are pleased to know your issue is resolved. If you encounter any other problem, please feel free to post on our forums, we will be glad to help you further.