Error get export OleObjectFrame.ObjectData into Excel

Hi,

I want to get the data in OleObjectFrame, when I write to ObjectData into a Workbook, a null reference error occured : "Object reference not set to an instance of an object." I am sure that the MemoryStream is not null.

Am I doing something wrong? We are using the latest release Aspose.Slides for .NET 6.4.0 and Aspose.Cells for .NET 7.3.0.

Thanks.

Code:

Presentation pres = new Presentation("c:\\test.ppt");
Slide mySlide= pres.Slides[0];
OleObjectFrame oleObjectFrame = (OleObjectFrame) mySlide.FindShape("oleChart");
MemoryStream ms = new MemoryStream(oleObjectFrame.ObjectData);
//Stream ms = new MemoryStream();
//ms.Write( oleObjectFrame.ObjectData, 0, oleObjectFrame.ObjectData.Length);
//ms.Position = 0;
Workbook wb = new Workbook(ms);
--error:Object reference not set to an instance of an object.


Hi Katze,


I have observed the code snippet shared by you and have observed no issue in code snippet. Can you please share the source presentation with us so that I may further observe the issue on my end.

Many Thanks,

Hi,


The source presentation attached here, thanks.

Hi Katze,


I have observed the presentation file shared by you and have observed that you are using MS Graph in your presentation as Ole frame. Aspose.Slides is able to extract the graph but I doubt that support for MS Graph is available in MS Excel. That is why, you are getting NullReferennceException. However, I have requested Aspose.Cells team to have a look over the issue and share their response. They will further share that whether support for loading MS Graph file is available in Aspose.Cells or not.

Many Thanks,

Hi,

I am from Aspose.Cells team. MS Graph Chart is different package where as MS Excel has different set of file formats. Aspose.Cells is an MS Excel (97-2010) spreadsheet product/component used to create, manage, manipulate or convert MS Excel (97-2010) files (XLS, XLSX, CSV, SpreadsheetML, Tab delimited etc.). Since your presentation has MS Graph Chart object as an OLE Object, so it is not supported.

Thank you.

Thanks a lot.
Is there any solution to update the data in that MSGraph.Chart in the presentation?

Hi,

Thanks for your question.

I am afraid, you cannot update MsGraph chart using any Aspose components. If you want to manipulate or update your chart, please us Ms-Excel chart inside your Ms-PowerPoint document which you can then update using Aspose.Cells.

Hi Katze,


I regret to share that presently there is no solution that Aspose can offer you in updating MSGraph charts. However, you can have excel charts and update them using Aspose.Slides and Aspose.Cells. More importantly, Aspose.Slides offer creating charts in it. Please visit this documentation link for your kind reference.

Many Thanks,