Aspose cells get file styles

Hi Aspose support team,
We’re using a aspose cells for java. and we have a valid license.
I’m trying to get the cell style from a excel template, but with no sucess.
I want to get a cell style, to apply to a new cells.
Is that possible?
Thanks in advance,
Kind regards,
Paulo

@paulo_pereira,

Thanks for your query.

You may please give a try to the following sample code and provide your feedback.

Workbook wb = new Workbook(path + "book1.xlsx");
var style = wb.getWorksheets().get(0).getCells().get("A1").getStyle();
StyleFlag flag = new StyleFlag();
flag.setAll(true);
wb.getWorksheets().get(0).getCells().get("A2").setStyle(style, flag);
wb.save(path + "outputJava.xlsx");

outputJava.zip (7.0 KB)
Book1.zip (6.8 KB)