1、设置excel受保护,并且设置密码
sheet.protectSheet("密码");
2、设置单元格锁定
HSSFCellStyle unlockstyle = workbook.createCellStyle(); unlockstyle.setLocked(false); cell.setCellStyle(unlockstyle);
3、设置公式
String sumString = "SUM(G1:R1)"; cell.setCellFormula(sumString);
4、对某一列进行隐藏
// 对第一列进行隐藏 sheet.setColumnHidden((short)0, true);