I'm trying to read embedded objects in an excel spreadsheet and am getting
"Unable to read entire header; 0 bytes read; expected 512 bytes" exception
for all embedded objects when I try to read the embedded object. It can be
another spreadsheet, word doc or ppt object. I'm able to read the docs
individually with poi and when they are embedded in a ppt file using hslf.
The exception is thrown when the new workbook object is creating. I've been
struck on this problem and haven't been able to find anyone else with this
issue, any help would be appreciated.
using poi 3.2final.
excel spreadsheet is getting created with MS Excel 2000.
filename is an InputStream.
HSSFWorkbook wb = new HSSFWorkbook(filename, false);
for (Iterator<HSSFObjectData> doList =
wb.getAllEmbeddedObjects().iterator(); doList.hasNext(); ) {
HSSFObjectData dataObject = (HSSFObjectData) doList.next();
if(dataObject.hasDirectoryEntry()){
oleName = dataObject.getOLE2ClassName();
if("Worksheet".equals(oleName)){
HSSFWorkbook wBook = new HSSFWorkbook(new
ByteArrayInputStream(dataObject.getObjectData()));
}
}
}
--
View this message in context:
http://www.nabble.com/embedded-objects-in-HSSF-tp24625249p24625249.html
Sent from the POI - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]