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

Free Support Forum - aspose.com

How do I set outline for NamedRange in Java?

In the following article of the Aspose documentation: http://www.aspose.com/documentation/file-format-components/aspose.cells-for-.net-and-java/adding-borders-to-cells.html

It has a section titled “
Adding Borders to a Range of Cells” which describes how to create a Range and apply a border outline to the entire range.

How do I accomplish this using Java?

Thanks

Hi,<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thank you for Considering Aspose.

Please see the following code sample which will help you get your desired results.

Sample Code:-

//Instantiating a Workbook object

Workbook workbook = new Workbook();

Worksheets worksheets = workbook.getWorksheets();

//Accessing the first worksheet in the Excel file

Worksheet sheet = worksheets.getSheet(0);

Cells cells = sheet.getCells();

//Creating a named range

NamedRange namedRange = cells.createNamedRange("TestRange","B4", "G14");

namedRange.setOutlineBorder(int, Color);

//Saving the modified Excel file in default format

workbook.save("C:\\output.xls");

Thank you and Best Regards,

Thanks for your reply!

Oh I just noticed this is a new feature just added, so I do not have the updated software required for this method.

I will see about getting it now, thanks.