Created attachment 26761 [details] Template Excel file with user-defined cellstyle "FatFont" Please see the following snippet of code which detects a user-defined cellstyle in an Excel file and then tries to apply this celstyle on the top left cell in the 'MySheet' worksheet. HSSFWorkbook wb = new HSSFWorkbook(new FileInputStream("template.xls")); for(short i = 0; i < wb.getNumCellStyles(); i++) { HSSFCellStyle cs = wb.getCellStyleAt(i); String userStyleName = cs.getUserStyleName(); if(userStyleName != null && userStyleName.equals("FatFont")) { System.out.println("Found!"); wb.getSheet("MySheet").getRow(0).getCell(0).setCellStyle(cs); break; } } FileOutputStream fos = new FileOutputStream("template2.xls"); wb.write(fos); fos.close(); When opening template2.xls it can be seen that applying the detected cellstyle actually had no effect. Please find the file template.xls attached.
Fixed in r1080689 Yegor
*** Bug 50302 has been marked as a duplicate of this bug. ***