I tried to use a existing xls-File as template. The file could be read and manipulated using POI. But when opening the written file Excel will view nothing. No error message, no crash but also no content of the file. I used POI 2.5 and Excel 2000.
I noticed that the size of the file after it has been modified using POI is smaller than before modifying it... the only modification i do is to change a value of one cell... original size was 42KB new size is 29KB I'm using poi 2.5 and Excel 97
I have verified that this behaviour is not exhibited by version 2.0.
I have been experiencing many problems with images and POI using both 2.5.1 and 3.0-alpha including this crash bug.
This also occurs on Macintosh (OS X 10.4 Tiger).
We have had the same issue. We found a work around for us working with Alpha2, 3 and RC1. We stored the image to a file, removed the image from the xls and re-inserted it by Insert -> Image -> From file. Regards Joern
Just verified it in a very simple document with POI from SVN. Still doesn't work, after inserting one of the problematic images with "Insert -> Image -> From file" the document won't open. Sometimes the images work, sometimes they don't. It's very strange.
Created attachment 19781 [details] a working Excel template (untouched by POI)
Created attachment 19782 [details] a working Excel template (untouched by POI)
Created attachment 19783 [details] a working Excel template (after being processed by POI)
Created attachment 19784 [details] a working Excel template (after being processed by POI)
Created attachment 19785 [details] a Excel template resulting in a crashing Excel document (untouched by POI)
Created attachment 19786 [details] a Excel template resulting in a crashing Excel document (untouched by POI)
Created attachment 19787 [details] a crashing Excel document (after being processed by POI)
Created attachment 19788 [details] a crashing Excel document (after being processed by POI)
I added some testcases, working and non-working versions before and after being touched by POI.
Julien, I think I fixed it. Apply the patch and let me know if the problem disappeared. If everything is okay, I will commit the fix. Regards, Yegor
Created attachment 19797 [details] Patch for Bug 28744
Yes. Yes, indeed, that seems to fix it. Thank you very much! Now I have another problem. Using the current POI version, formulas don't get reevaluated automatically? Even pressing F9 doesn't help. I have to put the mousecursor into the cell and press enter, or do wacky things like replacing all '=' with '=', just to get Excel to reevaluate the formulas... This is of course not connected to your patch or this problem, it's a POI 3.0 thing. With 2.5.1, everything works. Except for the images. I tried somehow applying your patch to 2.5.1, but it seems that there are quite some differences. I suppose it would be very hard to get this patch working with 2.5.1?
I can recreate this, but only when using Excel with Office Service Pack 3 installed. Files with images modified by POI cannot be loaded into Excel once Office SP3 has been installed.
Fixed in trunk Yegor