Free Support Forum - aspose.com

Problems in updating OLE image

Hi,

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.

Thanks.
Roy

Hi Roy,


I have worked over the issues shared by you in detail and will try to answer them individually.

Issue 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.

I like to share that this issue is related to Aspose.Cells and I will request my team mate from Aspose.Cells to share his response in this regard.

Issue 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?

I like to share that at the moment the feature for removing the unused images from the presentation image collection is unavailable and I have created an issue with ID SLIDESJAVA-33763 in our issue tracking system to further investigate the possibility of implementing the requested feature. This is why you are getting exception while removing image from collection.

Issue 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 have observed the sample code shared for adding/changing image for Ole frame and it is OK. I have opened the generated presentation in PowerPoint 2010 on my end and have observe no issue while opening the Workbook object. For your convenience, I have shared the generated presentation and snapshot of opened workbook as well. Can you please share with what issue with workbook you observed while opening Ole frame along with snapshot of the issue. Please also share the PowerPoint version used on your end.

We are sorry for your inconvenience,

Hi Mudassir,

I am using Powerpoint 2010. I attached the pptx file and screenshots when I tried to open the chart object in Powerpoint.

Thanks,
Roy

Hi Roy,


I have observed the images shared and have been able to access the workbook object on my end. I have observed the minor issue on your end while select the chart and accessing the workbook object for that. Please observe the shared image and the encircled highlighted chart areas. The chart opened on the left side of the image is the one that I have accessed in my PowerPoint and the one on right is one of your’s shared image. You need to select the chart. When you select the chart, you will find a thick border appearing around the chart as shown in red encircled area on the image. After this, when you will right click on the chart, you will see the desired options. Please share, if I may be of any further help in this regard.

Many Thanks,

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.

Thanks,
Roy

Hi Roy,


I have observed the issue shared by you and have not been able to reproduce the same on my end. In my humble opinion, all one need to do is to select the chart and it will work. Please share, if I may help you further in this regard.

Many Thanks,

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.

Hi Roy,


I have observed the issue shared. It is in fact not an issue and the effect you are getting is due to presence of watermark on behind of the chart. For sake of assurance, please check the presentation file shared by me earlier. Please share, if I may help you further in this regard.

Many Thanks,