Hello.
I have a problem with copying Workbook.
When I make a copy - it copy only data in workbook.
But I need to copy settings too.
How I should it to do ?
For example this test. I set calculate mode to Manual. But after copy new workbook has Automatic calculate mode
@Test
public void copy_workbook() throws Exception {
Workbook workbook = new Workbook();
workbook.getWorksheets().add();
Worksheet worksheet = workbook.getWorksheets().get(0);
worksheet.getCells().get("A1").setValue("1");
workbook.getSettings().getFormulaSettings().setCalculationMode(CalcModeType.MANUAL);
Workbook copiedWorkbook = new Workbook();
copiedWorkbook.copy(workbook);
assertEquals(workbook.getWorksheets().get(0).getCells().get("A1").getValue(), copiedWorkbook.getWorksheets().get(0).getCells().get("A1").getValue());
assertEquals(workbook.getSettings().getFormulaSettings().getCalculationMode(), copiedWorkbook.getSettings().getFormulaSettings().getCalculationMode());
}