// Create a new workbook Workbook workbook = new Workbook(); // Document Solutions for Excel supports open xlsm file workbook.open("macros.xlsm"); // Macros can be preserved after saving workbook.save("macros-exported.xlsm");