https://bz.apache.org/bugzilla/show_bug.cgi?id=62017
Bug ID: 62017
Summary: Writing more than 1024 OLE objects in a single
spreadsheet creates probably an invalid file
Product: POI
Version: 3.17-FINAL
Hardware: PC
Status: NEW
Severity: normal
Priority: P2
Component: XSSF
Assignee: [email protected]
Reporter: [email protected]
Target Milestone: ---
Created attachment 35684
--> https://bz.apache.org/bugzilla/attachment.cgi?id=35684&action=edit
Contains the Excel file with 5000 OLE objects in it, and the source code of the
program I've written.
Hi:
I have attached a test program that triggers the error. Basically, this is how
I trigger the error:
- The program create more than 1024 OLE objects and anchors in an Excel sheet;
- The generated file is opened and saved with Excel - in this process, the
Excel file size shrinks;
- When loading the Excel file, errors are thrown.
This is a sample of the error:
Failed to add a shape to the collection, row no [0], shape will be ignored
[org.apache.poi.POIXMLException: Ole object not found in sheet container - it's
probably a control element]
org.apache.poi.POIXMLException: Ole object not found in sheet container - it's
probably a control element
at
org.apache.poi.xssf.usermodel.XSSFObjectData.getOleObject(XSSFObjectData.java:132)
at
org.apache.poi.xssf.usermodel.XSSFObjectData.getObjectPart(XSSFObjectData.java:151)
at
com.emerald_associates.spreadsheetimpexp.sketch_board.ApachePoiMultipleOleObjectsBug.lambda$testRead$0(ApachePoiMultipleOleObjectsBug.java:137)
at java.util.ArrayList.forEach(ArrayList.java:1249)
at
com.emerald_associates.spreadsheetimpexp.sketch_board.ApachePoiMultipleOleObjectsBug.testRead(ApachePoiMultipleOleObjectsBug.java:131)
at
com.emerald_associates.spreadsheetimpexp.sketch_board.ApachePoiMultipleOleObjectsBug.main(ApachePoiMultipleOleObjectsBug.java:90)
The problem occurs for each OLE object added above 1024. So if I add 1050 OLE
Objects, I will get 26 errors.
I am using Apache POI 3.17, Java 8, and Excel 2017 from Office 365. To me, it
appears that the file is generated with some sort of error that Excel clears up
when it opens the file.
We also created a sample file where 5000 OLE objects were created with Excel -
I am attaching that file here - in this example, there are no errors when the
OLE objects are read with the test program.
Attached I am sending the test program I've written, and the Excel file with
the 5000 OLE objects. Running the program should trigger the error, just follow
the instructions on it.
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]