Free Support Forum - aspose.com

Get "Print_Area" Range

Hi Team,

I need to get "Print_Area" range in Aspose cells release 3.1.0.0.

Is posible? I use this code but it returns null:

Name name = workbook.Worksheets.Names[i];

Range range = workbook.Worksheets.GetRangeByName(name.Text);

Best Regards, Jorge

Hi,

Thank you for considering Aspose.

We have found your mentioned issue after an initial test. We will look into it and get back to you soon. Your issue has been registered in our Issue Tracking System with issue id CELLSNET-11193.

Thank You & Best Regards,

Hi,

Thank you for considering Aspose.

After further checking your issue, “Print_Area” named range comes under Worksheet name ranges and you may access it with worksheet reference. Please see the following sample code for your reference.

Workbook workbook = new Workbook();

workbook.Open(@"C:\\Templates\\test_file.xls");

Name name = workbook.Worksheets.Names[0];

Range range = null;

if (name.SheetIndex == 0)//belongs to workbook

{

range = workbook.Worksheets.GetRangeByName(name.Text);

}

else

{

range = workbook.Worksheets.GetRangeByName( workbook.Worksheets[name.SheetIndex - 1].Name + "!" + name.Text);

}

If you still face any problem, please share your template file and we will check it soon.

Thank You & Best Regards,