R
Remo
Gast
Hi
habe eine Frage zur setLocked Methode von HSSFCellStyle von der POI-Library!
warum funktioniert es nicht, dass die Zelle gelockt ist, also gesperrt?
Danke für Hilfe
Gruss Remo
habe eine Frage zur setLocked Methode von HSSFCellStyle von der POI-Library!
warum funktioniert es nicht, dass die Zelle gelockt ist, also gesperrt?
Code:
public class TestExcel {
public static void main(String[] args) throws IOException {
new TestExcel();
}
public TestExcel() throws IOException{
File test = new File("test.xls");
FileOutputStream fos = new FileOutputStream(test);
HSSFWorkbook workbook = new HSSFWorkbook();
HSSFSheet sheet = workbook.createSheet("Test");
HSSFRow row = sheet.createRow(0);
HSSFCell cell = row.createCell((short)0);
cell.setCellValue("Hallo");
HSSFCellStyle style = workbook.createCellStyle();
style.setLocked(true);
cell.setCellStyle(style);
workbook.write(fos);
}
}
Danke für Hilfe
Gruss Remo