If I have a simple Excel file with a single sheet with a diagram in it, try to clone it, I get the following Exception: java.lang.RuntimeException: The class org.apache.poi.hssf.record.ProtectRecord needs to define a clone method at org.apache.poi.hssf.record.Record.clone(Record.java:247) at org.apache.poi.hssf.model.Sheet.cloneSheet(Sheet.java:291) at org.apache.poi.hssf.usermodel.HSSFSheet.cloneSheet (HSSFSheet.java:149) at org.apache.poi.hssf.usermodel.HSSFWorkbook.cloneSheet (HSSFWorkbook.java:351) There is no encryption used in the book, it is a simple Excel file created from scratch (Using Excel 2000 SR-1). I read and write the file using the following code: HSSFWorkbook book = new HSSFWorkbook(new FileInputStream(path)); book.cloneSheet(0); FileOutputStream fOut = new FileOutputStream(XLS_PATH + XLS_OUT); book.write(fOut); fOut.close(); The POI version I use is jakarta-poi-1.11.0-dev-20030225.jar
Add protect record to the list. Also, this needs to be documented for people writing new records. *** This bug has been marked as a duplicate of 15050 ***