Created attachment 26585 [details] source We need to read excel template file, and add some comments to some cells of the worksheet . The excel template file has a few comments and Shapes. when We open the file, we alwasys get the error "File Error: data may have been lost". Please help.
What version of excel is this with? And what parts of the file were affected? If you save the version that excel has fixed up, how does that differ from the poi one?
Excel Version: Microsoft Office Excel 2003(11.8328.8329) SP3 i think Sheet.aggregateDrawingRecords(..) were affected. I don't know what's difference.
Can you try using org.apache.poi.hssf.dev.BiffViewer to identify the key records?
Created attachment 26615 [details] the result of BiffViewer
i don't know which part is wrong. can you check the attachment files
It is a limitation of HSSF - comments are graphic objects and HSSF can create drawings from scratch, but cannot modify existing ones. This means that if you add an comment to a sheet that already has graphic objects (comments, shapes, pictures, etc.) then the existing graphic objects are invalidated. Yegor
*** Bug 47624 has been marked as a duplicate of this bug. ***
This problem should be fixed in trunk. Please try with a nightly build - see download links on http://poi.apache.org/ or build yourself from SVN trunk, see http://poi.apache.org/subversion.html