Bug 31016

Summary: Cannot Open XL with Macro
Product: POI Reporter: Sowmini Ramana <psowmini>
Component: POI OverallAssignee: POI Developers List <dev>
Severity: major    
Priority: P3    
Version: 2.5-FINAL   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   

Description Sowmini Ramana 2004-09-02 15:12:48 UTC
 I am trying to open an XL file that has macros written in it.

InputStream myxls = new FileInputStream(getServletContext().getRealPath("/") 
+ "docs\\Payment Request.xls");

HSSFWorkbook wb     = new HSSFWorkbook(myxls);

The above 2 lines are in a servlet and I am testing the servlet from the 
browser. The following exception is thrown at line 2 and the exception is

500 Unable to construct record instance, the following exception occured: null
Unable to construct record instance, the following exception occured: null 

I have tested the 2 lines of code with a password protected XL file, it works 
fine. I tested the above 2 lines with a plain XL file works beautifully. 

I have no clue, Please let me know if any workaround or fix is available. Will 
be able to send XL file on request, since the bug entry screen doesn't have a 
field for attachements

FYI, I am using poi-bin-2.5.1-final-20040804 version of POI

Thanks in adance,
Sowmini Ramana
Comment 1 Glen Stampoultzis 2004-09-19 01:23:13 UTC
Difficult to say what your problem is without seeing an example workbook.
Comment 2 Josh Micich 2008-08-25 13:02:42 UTC
This was probably fixed some time ago. Recent versions of POI preserve VBA macros OK.

Please re-open if you can provide an example spreadsheet which is not handled correctly.