I have a program that tries to do the following:
1. Open a presentation with an embeded OLE object from Excel.
2. Find the OLE object in the presentation
3. Open a new Excel workbook with a different chart
4. Update the OLE object with the new data read from the new Excel file.
5. Update the OLE image in the presentation
6. Save the presentation as a new file.
Now, there are several problems I encountered:
1. If I open the Excel with method ‘new Workbook(filepath)’, it works fine. But if I open the file with ‘new Workbook(FileInputStream)’ constructor, the workbook object does not contain any chart.
2. I tried to remove the old OLE image from the presentation object, it throws UnsupportedOperationException. How do I remove un-used OLE images from a presentation?
3. The new presentation that was saved DOES use the new OLE image. However, when I right click on the chart, it does not show ‘Worksheet Object’ in the right click pop up. If I comment out the code to update the ole image, then the saved presentation shows the OLE image, and the right click on the OLE image does show ‘Worksheet Object’. So how do you update the OLE data as well as its image?
I attached my java code and the pptx and xlsx files.
I am using Powerpoint 2010. I attached the pptx file and screenshots when I tried to open the chart object in Powerpoint.
Thanks for your help. I was able to select the image and right click and get the worksheet option. But what is strange is that, it does not behave the same anywhere on the image. Only on certain part of the image this works. I am not sure why.
I am not sure if this is related to the specific document, or the Powerpoint installation on my computer. But on my computer, for the Aspose-generated powerpoint file with embedded OLE Excel chart, sometimes it appears that even if the OLE object has been selected, the mouse right click will only have a “Move Here, Copy Here, Cancel” selection. This never happens on a Powerpoint file that I manually inserted an OLE Excel chart myself, only on Aspose-generated files. I attached the screenshot where you can see that the border of the OLE object is thick indicating that it was selected. Thanks.