Hi there, Is there an example for embedding Excel Object into PPTX slide?
I'm getting an error (please refer to the error message in attached .jpg file) when embedding Excel Object into PowerPoint SlideEx (2007) and I'm using the following code:
'Instantiate a Presentation object that represents a PPTX file (already exist)
Dim pres As PresentationEx = New PresentationEx("C:\Work\template.pptx")
'** Clone the last slide
pres.Slides.AddClone(pres.Slides(pres.Slides.Count - 1))
'*** do stuff
'Create a workbook
Dim wb As New Aspose.Cells.Workbook
' template excel file with only one chart in the sheet named "ChartSheet"
wb.Open(filePath & "\template.xlsx", FileFormatType.Excel2007Xlsx)
' get image of the chart
Dim imgChart As Bitmap = wb.Worksheets("ChartSheet").Charts(0).ToImage()
'Save the workbook to stream
Dim wbStream As MemoryStream = wb.SaveToStream
Dim imgChartEx As ImageEx = pres.Images.AddImage(imgChart)
Dim sldSize As SlideSizeEx = pres.SlideSize
Dim chartOleData(wbStream.Length) As Byte
wbStream.Position = 0
wbStream.Read(chartOleData, 0, chartOleData.Length)
Dim oof As Aspose.Slides.Pptx.OleObjectFrameEx = sld.Shapes.AddOleObjectFrame(0, 0, sldSize.Size.Width , sldSize.Size.Height, "Excel.Sheet.8", chartOleData)
oof.Image = imgChartEx
Am i doing something wrong?
Thanks