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

Free Support Forum - aspose.com

OleObjectFrame - how to assign a picture to it

Aspose Team,
I am using Aspose Slides for .NET v 14.4. I am adding an Excel sheet to the slide as an Ole object.
The sheet is in memory.. It is not an actual file.

byte[] oleData = new byte[st.Length];
st.Position = 0;
st.Read(oleData, 0, oleData.Length);
OleObjectFrame oof = (OleObjectFrame) slide.Shapes.AddOleObjectFrame(xPx, yPx, itemWidthPx, itemHeightPx, "Excel.Sheet.12", oleData);

The Ole object is inserted and it displays "Embedded OLE Object" in big red letters. I would like to display an image of the Excel sheet instead.

There used to be a way to do that in version 13:
oof.Image = p.Images.AddImage(bmp); // version 13.x

How do I do this in version 14 please?
Thanks,
Ana Ortega

Hi Ana Ortega,


I have observed the requirements shared by you and suggest you to please try using the following sample code on your end.

oof.SubstitutePictureFormat.Picture.Image = pres.Images.AddImage((System.Drawing.Image)imgChart);

Please share, if I may help you further in this regard.

Many Thanks,

Thank you. It worked.