java poi修改Excel单元格格式无效

// 创建对Excel工作簿文件的引用
HSSFWorkbook workbook = new HSSFWorkbook(new FileInputStream(path));
HSSFCellStyle cellStyle =workbook.createCellStyle();
cellStyle.setFillBackgroundColor(HSSFColor.RED.index);
cellStyle.setFillPattern(HSSFCellStyle.SOLID_FOREGROUND);
.....................................
cell.setCellStyle(cellStyle);

        //读取excle文件, 校验单元格数据,如果格式不对。就需要修改单元格样式。

没看出来是哪里有问题,试问失效有没有报错之类的?

HSSFWorkBooK用法

http://www.cnblogs.com/zhenmingliu/archive/2012/04/25/2469396.html