Bug 41415

Summary: HSSFWorkbook getBytes() method removes macro
Product: POI Reporter: Michael Guzman <mikhailguzman>
Component: HSSFAssignee: POI Developers List <dev>
Status: RESOLVED INVALID    
Severity: normal    
Priority: P2    
Version: 3.0-dev   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Attachments: Excel file with macro that I use

Description Michael Guzman 2007-01-19 08:37:04 UTC
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.
Comment 1 Michael Guzman 2007-01-19 08:43:12 UTC
Created attachment 19434 [details]
Excel file with macro that I use
Comment 2 Andy Oliver 2007-01-19 10:17:46 UTC
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)