Meaningless Drivel is fun!*
The moose likes Other Open Source Projects and the fly likes Problem in reading macros of Exel file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Other Open Source Projects
Bookmark "Problem in reading macros of Exel file" Watch "Problem in reading macros of Exel file" New topic
Author

Problem in reading macros of Exel file

Nishita Jain
Ranch Hand

Joined: Mar 30, 2006
Posts: 97
Hi all,
i am using POI API for reading the Excel data . but in excel file contains some macros, list box buttons that is why i m facing some problem in reading that. i installed newer version of poi api 3.0 but i m getting problem in reading that. i m getting this execption
org.apache.poi.hssf.record.RecordFormatException: Unable to construct record instance
at org.apache.poi.hssf.record.RecordFactory.createRecord(RecordFactory.java:191)
at org.apache.poi.hssf.record.RecordFactory.createRecords(RecordFactory.java:115)
at org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:205)
at org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:153)
at com.wipro.cairn.sunupload.biz.WorkBookExelReader.validateExcelFields(WorkBookExelReader.java:46)
at com.wipro.cairn.sunupload.biz.SunDataUploader.actionPerformed(SunDataUploader.java:123)Is file
An error occured while reading the file

at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
at java.awt.Component.processMouseEvent(Unknown Source)
at javax.swing.JComponent.processMouseEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at org.apache.poi.hssf.record.RecordFactory.createRecord(RecordFactory.java:179)
... 29 more
Caused by: org.apache.poi.hssf.record.RecordFormatException: HSSF does not currently support encrypted workbooks
at org.apache.poi.hssf.record.FilePassRecord.fillFields(FilePassRecord.java:70)
at org.apache.poi.hssf.record.Record.<init>(Record.java:56)
at org.apache.poi.hssf.record.FilePassRecord.<init>(FilePassRecord.java:53)
... 34 more

As the bold text says that Its not supported? than means no solution to that?
Actually i have to deliver this fast and have code for POI sowhat should i do in this case?


thanks,
Nishita
[ July 03, 2007: Message edited by: Nishita Jain ]

Nishita
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

Here's the reason (lifted directly from the POI JavaDocs):

( HSSF does not support encryption because we don't feel like going to jail )

[ July 03, 2007: Message edited by: Paul Sturrock ]

JavaRanch FAQ HowToAskQuestionsOnJavaRanch
dexter ramirez
Greenhorn

Joined: Jul 10, 2007
Posts: 4
try to use jexcel API.

easy to use..
 
 
subject: Problem in reading macros of Exel file
 
Similar Threads
POI- Exception
Problem in reading macros of Exel file
Poi's Upload problem: RecordFormatException
Problem in reading macros of Exel file
Auto Filter using POI