OleObjectFrameEx

Hey ,


I’m trying to embed OLEobject in powerpoint presentation taking the input from excel , this is the code .
String path = @“D:\Data\desktop”;
PresentationEx pres = new PresentationEx();
FileStream fstro = new FileStream(path + “btrbir.xlsx”, FileMode.Open, FileAccess.Read);
byte[] b = new byte[fstro.Length];
fstro.Read(b, 0, (int)fstro.Length);
OleObjectFrameEx oof = pres.Slides[0].Shapes.AddOleObjectFrame(60, 60, 400, 400, “Excel.Sheet.12”, b);
HyperlinkEx link = new HyperlinkEx(path + “btrbir.xlsx”);
oof.HLinkClick = link
pres.Write(path + “btrbir.pptx”);
u can find in the attached files the Excel that im using to draw my OLEobject and the btrbir.pptx which is the output where it is displaying ( NO IMAGE) , also please i want to know how can i specifiy columns and rows to select in order to use them in my embeded Object (in case i dont want to copy all the xlsheet)

Regards,
Kamel



Hi Kamel,

I have observed the presentation shared by you and like to share that the “No Image” message is in fact not an issue wiht Aspose.Slides but is in fact representation by Ole frame Engine that the ole frame is in disabled form. It is infact information for the viewer to enable the Ole frame. There are two ways to counter this problem. One way is to use some third party macros that you can google over the internet. The third party macros enables the Ole frames inside presentation once it is opened in PowerPoint. This way you will have to do nothing but to find some macro to do the job for you. For further information please visit the documentation link and documentation link2.

The other solution that Aspose.Slides offers involves Aspose.Cells in it. In this approach you access the Ole frame worksheet and then generate the actual chart or worksheet image in excel file that is to be added as ole frame. Once image is extracted then add that to presentation Images collection and setting that as Ole frame image. This way when the presentation will be opened, you will see the actual sheet or chart image even with ole frame being disabled. I have attached the sample application for your kind reference in this regard.

Many Thanks,