https://issues.apache.org/bugzilla/show_bug.cgi?id=53678
--- Comment #3 from Tom Cole <[email protected]> --- I believe this condition exists with any Form Control. I have attached a workbook where the first sheet has a form control button on it. If you clone that sheet, the generated sheet has errors in it. If you remove the form control, the sheet clones just fine (even with conditional formatting). I used the following program to clone the original: public class ReadWriteTest { public ReadWriteTest(String input, String output) { try { File inputFile = new File(input); if (inputFile.exists()) { Workbook excel = new XSSFWorkbook(new FileInputStream(inputFile)); Sheet newSheet = excel.cloneSheet(0); excel.setSheetName(excel.getSheetIndex(newSheet), "Clone"); File outputFile = new File(output); boolean create = ! outputFile.exists(); if (! create) { create = (JOptionPane.showConfirmDialog(null, "File exists, do you want to overwrite?") == JOptionPane.OK_OPTION); } if (create) { excel.write(new FileOutputStream(outputFile)); } System.exit(0); } else { System.out.println("Input file " + input + " not found."); System.exit(1); } } catch(Exception ex) { ex.printStackTrace(); System.exit(1); } } public static void main(String[] args) { if (args.length == 2) { new ReadWriteTest(args[0], args[1]); } else { System.out.println("USAGE: ReadWriteTest <input_file_name> <output_file_name>"); System.exit(1); } } } -- You are receiving this mail because: You are the assignee for the bug. --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
