Not able to embed excel in ppt

Hi team, 
I am not able to embed excel file to Power point slide created with syncfusion. All I get is corrupted ppt with embedded excel not opening. I need to embed excel as OleDB object, not import data from excel. Below is the code used:

 ISlide slide = pres.Slides.Add(SlideLayoutType.Blank);
             FileStream excelStream = new FileStream(@"C:\Project\Reports\ExcelSample.xlsx", FileMode.Open);
            FileStream imageStream = new FileStream(@"C:\Project\excel.png", FileMode.Open);

            slide = pres.Slides[0];
            Syncfusion.Presentation.IOleObject oleObject = slide.Shapes.AddOleObject(imageStream, "Excel", excelStream);
            oleObject.Left = 10;
            oleObject.Top = 10;
            oleObject.Width = 40;
            oleObject.Height = 30;
            FileStream outputStream = new FileStream(@"C:\Project\Reports\OleObjectSample.pptx", FileMode.Create);
            pres.Save(outputStream);

Kindly help

1 Reply 1 reply marked as answer

LB Lokesh Baskar Syncfusion Team March 22, 2021 12:40 PM UTC

Hi Kavipriya,

Thank you for contacting Syncfusion support. 

To achieve your requirement, we suggest you to set the parameter as “"Excel.Sheet.12"” to add excel as OLE object in Presentation. Please refer the below UG documentation link to know more about inserting excel as OLE object in Presentation:
https://help.syncfusion.com/file-formats/presentation/working-with-ole-objects#inserting-ole-object-to-a-slide  

Please let us know if you have any questions. 

Regards,
Lokesh B 


Marked as answer
Loader.
Up arrow icon