Insert Excel chart into PPT as OLE object

Hi!

We have changed the way we generate our XLS files with chart from Spreadsheetgear to Aspose.
We provide a function, that these are embedded into a PPT file.

In the past everything went well, we used Chart.ToImage() function to generate the image, that will be displayed in the PPT and added the XLS file behind as OLE object.

But now, the Chart.ToImage() returns the chart without real data. The title, series names and category names can be seen, but the numeric data is not displayed (e.g. columns in the column chart)

If I open the generated XLS file in Microsoft Excel, save it and embed that in the PPT, everything is correct.

Do you have any idea, what can be the solution?

Hi László,

Thanks for your posting and using Aspose.Cells for .NET.

It seems Chart.ToImage() function is not working with your source file. Please download and use the latest version: Aspose.Cells
for .NET v7.6.0.6
and see if it resolves your issue. If the issue still persists, then please provide us your source xls/xlsx file with your chart. We will look into this issue and help you asap.

I have found the cause of the problem.
For the chart I have used cells, that had formulas in it, which have not been calculated automatically.

It worked when simply exporting the XLS, because Microsoft Excel immediately calculated the formulas after opening the file.

Hi,


I think you may try to call Workbook.CalculateFormula() method before rendering chart to image file. This method is used to calculate all the formulas in the spreadsheet, so that your chart is rendered with the most updated values against formulas.

Let us know if you still find the issue.

Thank you.