PowrtPoint 2007 with embedded Excel 2007

Hi,

I am evaluating Aspose.Slides (.NET) version 4.4.8.0 and Aspose.Cells (.NET) version 5.2.2.2.

I have a PowerPoint 2007 file which has an embedded Excel 2007 workbook. The embedded object is showing some data on a worksheet. All i am trying to do is open the pptx file using PresentationEx, finding the ole object frame, loading a Workbook from the byte array, inserting a single row of data into the worksheet and then saving it back to presentation.

I can open the presentation fine but when I right click on the embedded object and go to Worksheet Object menu - it only lists Convert ... menu action (instead of Edit and Open action). When i click on the Convert menu action - I get an error message 'The server application, source file, or item can't be found, or returned an unknown error. You may need to reinstall the server application'. Needless to say - I can not get to the embedded object any longer.

Is it not supported or am Idoing something wrong? If it is supported - can you give me a code sample showing how to update embedded object in a presentation (2007). Thanks for any help on this.

Cheers.

Hi Mohammed,

I have worked this weekend for your issue and have generated the following code snippet for you. The source presentation shared has an excel file added as an Ole Frame using Aspose.Slides for .NET 4.4.10. Then the same source presentation is read and modified and edited and saved using Aspose.Slides for .NET 4.4.10. I am able to open the generated presentation and can also Ole Frame data by double clicking it in PowerPoint 2007 SP2 with latest updates. Please share, if you may still feel any issue. I have used Aspose.Cells for .NET 5.2.2 as well.

PresentationEx pres=new PresentationEx ("d:\\OleEmbed.pptx");

SlideEx slide = pres.Slides[0];

OleObjectFrameEx ole = null ;

foreach (ShapeEx shape in slide.Shapes)

{

if (shape is OleObjectFrameEx)

{

ole = (OleObjectFrameEx)shape;

}

}

if (ole != null)

{

Workbook Wb;

using (System.IO.MemoryStream msln = new System.IO.MemoryStream(ole.ObjectData))

{

Wb = new Workbook(msln);

using (System.IO.MemoryStream msout = new System.IO.MemoryStream())

{

Wb.Worksheets[0].Cells[0, 4].PutValue("E");

Wb.Worksheets[0].Cells[1, 4].PutValue(12);

Wb.Worksheets[0].Cells[2, 4].PutValue(14);

Wb.Worksheets[0].Cells[3, 4].PutValue(15);

Aspose.Cells.OoxmlSaveOptions so1 = new Aspose.Cells.OoxmlSaveOptions(Aspose.Cells.SaveFormat.Xlsx);

Wb.Save(msout, so1);

//Changing Ole frame object data

msout.Position = 0;

ole.ObjectData = msout.ToArray();

}

}

}

pres.Write("d:\\OleEdit.pptx");

Thanks and Regards,

Hi Mudassir ... thank you so mcuh for looking into this over the weekend. I am sorry that you had to work on the weekend but this did the trick. The latest version of Slides library and the fact you specified a OoxmlSaveOptions object did the job.

Thanklis very much for your help and sorry that you had to work on the weekend.

Cheers.

M.

Hi Mohammed,

I am grateful that things worked for you. We always believe in providing best possible help to our worthy customers.

Have a nice day,