Hi,
Thanks for your posting and using Aspose.Cells.
When you do not get expected results from getNamedRanges() method, you should try the getNames() method.
Please see the following sample code and its console output for your reference. As you can see it prints all the names (named ranges) of your workbook including print area named range.
Java
Workbook workbook = new Workbook(dirPath + “test.xlsx”);
NameCollection nms = workbook.getWorksheets().getNames();
int count = nms.getCount();
for(int i=0; i<count; i++)
{
Name nm = nms.get(i);
System.out.println(nm);
}
Console Output
Aspose.Cells.Name [ _Example; ReferTo:=Variables!$B$1]
Aspose.Cells.Name [ _Look; ReferTo:=Variables!$B$4]
Aspose.Cells.Name [ _Series; ReferTo:=Variables!$B$3]
Aspose.Cells.Name [ _Shading; ReferTo:=Variables!$B$2]
Aspose.Cells.Name [ Changedtemp1; ReferTo:=‘Balloon Payment Loan’!$B$2:$F$8]
Aspose.Cells.Name [ DATA_01; ReferTo:=#REF!]
Aspose.Cells.Name [ DATA_02; ReferTo:=‘Balloon Payment Loan’!$F$5:$F$8]
Aspose.Cells.Name [ IntroPrintArea; ReferTo:=#REF!]
Aspose.Cells.Name [ Look1Area; ReferTo:=#REF!]
Aspose.Cells.Name [ Look2Area; ReferTo:=#REF!]
Aspose.Cells.Name [ Look3Area; ReferTo:=#REF!]
Aspose.Cells.Name [ Look4Area; ReferTo:=#REF!]
Aspose.Cells.Name [ Look5Area; ReferTo:=#REF!]
Aspose.Cells.Name [ PRINT_AREA; ReferTo:=‘Balloon Payment Loan’!$B$2:$F$15]
Aspose.Cells.Name [ TamplateChanged; ReferTo:=‘Balloon Payment Loan’!$H$6]
Aspose.Cells.Name [ TemplatePrintArea; ReferTo:=‘Balloon Payment Loan’!$B$2:$F$15]
Aspose.Cells.Name [ F151SUM; ReferTo:null]