We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

How to control PowerPoint OLE Object scale height/scale width

Having followed the examples on Aspose.com, my code embeds an Excel Document into a Power Point presentation using Aspose.Slides for .NET 7.50. I also set an initial image on the object so that when the user opens the file they don’t get the Embedded Object placeholder.<?xml:namespace prefix = "o" ns = "urn:schemas-microsoft-com:office:office" />

This all works nicely, however when the user clicks on the object to open it, then clicks off, the object reshapes itself, and I think this is largely due to the Scale Height and Scale Width set by Aspose.Slides.

How can the scale height/scale width values be programmatically controlled?

I have attached several items:

PowerPointEmbeddedOleObjects.pptx, which shows the desired behaviour of clicking on an embedded object and clicking off. Note the object sizing keeps consistent. The documents were embedded using PowerPoint 2013

AsposeEmbeddedOleObjects.pptx which shows how the embedded objects have been embedded after using Aspose.Slides for .NET 7.5.0

1.jpg, 2.jpg and 3.jpg, which captures the behaviour of the before click, on click and after click state of an embedded excel document. Note the Scale Height and Scale Weight values.

Code.txt which shows the code used to embed an ole object.

LANDSCAPE.docx, PORTRAIT.docx, LANDSCAPE.xlsx, PORTRAIT.xlsx, the documents used to embed in the presentation, along with similarly named jpgs used to set as the ole object images.

Hi Craig,

I am sorry for the delayed response. I have observed the issue shared by you and yes you are right that you are probably encountering the scaling issue as PowerPoint and MS Excel sheets have different pixels per inch values. So, one need to scale these two different values to an approximately equal mapping. Please visit this documentation link for your kind reference and share a working sample along with problematic generated output with us if there is still an issue.

Many Thanks,