Bug 47920 - Can't embed HSSF into HSLF
Summary: Can't embed HSSF into HSLF
Alias: None
Product: POI
Classification: Unclassified
Component: HSLF (show other bugs)
Version: 3.7-dev
Hardware: PC Windows XP
: P1 major with 9 votes (vote)
Target Milestone: ---
Assignee: POI Developers List
Depends on:
Reported: 2009-09-30 07:01 UTC by Roman Durdik
Modified: 2010-02-14 17:03 UTC (History)
1 user (show)

Program showing the bug. (29.49 KB, application/zip)
2009-09-30 09:16 UTC, Roman Durdik
Eclipse Example Project showing the bug (66.88 KB, application/x-zip-compressed)
2010-01-28 07:29 UTC, pichlermeister

Note You need to log in before you can comment on or make changes to this bug.
Description Roman Durdik 2009-09-30 07:01:47 UTC
When the embedded Excel Workbook is opened and stored again into PowerPoint presentation, it is not possible to access it again. Please see the attachment for the program doing the action. There is also the template which consists the embedded excel workbook.
Comment 1 Roman Durdik 2009-09-30 09:16:22 UTC
Created attachment 24326 [details]
Program showing the bug.

The Eclipse project. The program opens powerpoint template and excel workbook inside it. Then it stores the workbook back to the powerpoint presentation and saves it into output directory. It is needed to put poi-3.5-FINAL-20090928.jar and poi-scratchpad-3.5-FINAL-20090928.jar into lib directory to run the program.
Comment 2 Yegor Kozlov 2009-12-15 01:40:56 UTC
Fixed in r890714

When embedding a workbook, MS Office modifies the .xls file and sets a special property called StorageClassID. It turned out that this property is important for embedded objects - MS Office uses it to activate the document's application. HSSFWorkbook did't preserve this property across read-write and it was the reason why PowerPoint could not open embedded .xls after modification.

Comment 3 pichlermeister 2010-01-28 07:13:34 UTC
Preview of embedded workbooks are not automatically updated when the content of the workbook gets overwritten.

When the embedded workbook is inline (shown as table/preview - not as icon as the example above) and gets opened and stored again with the content of another workbook, the workbook-preview of the output PowerPoint is still the same as before. 
When double-clicking on the embedded workbook of the output-PPT Excel opens with the new data and the preview gets updated.
Comment 4 pichlermeister 2010-01-28 07:29:55 UTC
Created attachment 24901 [details]
Eclipse Example Project showing the bug

Here is my Eclipse Example Project. 
I used the latest development build (poi-3.7-SNAPSHOT-20100126.jar and poi-scratchpad-3.7-SNAPSHOT-20100126.jar) of of apache poi because in Release 3.6 I couln't open the new workbook in my output presentation
Comment 5 Yegor Kozlov 2010-02-14 17:03:05 UTC
> Preview of embedded workbooks are not automatically updated when the content of
> the workbook gets overwritten.
Sorry, it's beyond the scope of POI. Generating of preview images is a feature of GUI (MS Office or OpenOffice). POI is a library to read/write office files, it can't emulate Excel UI and update the preview image.