You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@poi.apache.org by bu...@apache.org on 2010/12/12 13:26:07 UTC

DO NOT REPLY [Bug 50331] Writing HSSFWorkbook with macro causes lost macro project

https://issues.apache.org/bugzilla/show_bug.cgi?id=50331

Yegor Kozlov <ye...@dinom.ru> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |INVALID

--- Comment #1 from Yegor Kozlov <ye...@dinom.ru> 2010-12-12 07:25:59 EST ---
Pass 'true' as the second parameter in the constructor HSSFWorkbook(InputStream
is, boolean preserveNodes) and you will be good. Or better use the default
constructor HSSFWorkbook(InputStream is).

Excel file is a compound OLE2 document and the workbook stream and macros are
nodes of the OLE2 document.  The second boolean parameter tells POI whether to
preserve nodes other than Workbook, such as  macros. Passing 'false' truncates
the OLE2 file system to only the Workbook stream and document properties which
is exactly what is happening in your case. 

Yegor

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org