I have an existing workbook with a worksheet with a macro that does something. If I read this workbook into the HSSFWorkbook add some data and call method workbook.getBytes() to save it to the ServletOutputStream, the macro is lost. Saving byte array from getBytes() method to the file does not work neither. However, saving it to the file using workbook.write(FileOutputStream out) works fine.
Created attachment 19434 [details] Excel file with macro that I use
Ask on the mail list if you're doing it right before posting a potentially meaningless bug report (we do appreciate meaningful bug reports): http://jakarta.apache.org/poi/apidocs/org/apache/poi/hssf/usermodel/HSSFWorkbook.html#HSSFWorkbook(org.apache.poi.poifs.filesystem.POIFSFileSystem,%20boolean)