Excel spreadsheet as OleObject in Slides

I am creating a spreadsheet using aspose.cells in memory and then trying embed the worksheet in aspose.slide using slideex pptx presentation.

This is what I have tried. It works but it appears to embed the entire spreadsheet in the presentation. When I run this it appears to work but shows me a message "EMBEDDED OLE OBJECT". If I then click on this object it opens the spreadsheet but it is really large. What I would like to see happen is the spreadsheet to be visible in the presentation and only show the columns and rows that I have populated.

MemoryStream stream;
stream = workbook.SaveToStream();
OleObjectFrameEx oleObjectFrameEx = slideEx.Shapes.AddOleObjectFrame(0, 85, 100f, 200f, "Excel.Sheet.8", stream.ToArray());

How do I make this work?

Hi David,


I like to share that luckily I have worked over similar scenario for another customer. Please use the shared code snippet and it will help you further.

Many Thanks,

That didn't really help me. It appears like when I embed an ole spreadsheet it doesn't scale correctly. I've tried doing it using an image but that strips off some of the formatting like TextAlignment and I've tried not using excel but using tables and cells in aspose.slides but is missing so many simple features like how do you align text to the bottom of the cell that it's pretty much worthless.

I've also tried inserting an Excel Spreadsheet which is how that slides that I am trying to duplicate are created but aspose.slides doesn't support that feature.

Hi David,

I have observed several point raised by you in your query and I will try addressing them separately.

loussaertd:

That didn't really help me. It appears like when I embed an ole spreadsheet it doesn't scale correctly.

You have shared that it does not scale correctly. Please share the sample project that you are using and also share the generated output along with the desired output. The project code that I have shared with you actually resolves the scaling of Ole frame issue when getting enabled.

loussaertd:

I've tried doing it using an image but that strips off some of the formatting like TextAlignment and I've tried not using excel but using tables and cells in aspose.slides but is missing so many simple features like how do you align text to the bottom of the cell that it's pretty much worthless.

Can you please share the requirements that you are looking in Aspose.Slides table and found missing. I may investigate them on my end. Please provide the the sample project code along with generated and desired output in Aspose.Slides for reference.

loussaertd:

I've also tried inserting an Excel Spreadsheet which is how that slides that I am trying to duplicate are created but aspose.slides doesn't support that feature.


I have not been able to understand this point. Can you please elaborate this in detail.

Many Thanks,

Mudassir,

Attached find the pptx.

I was able to use your code and get this to scale correctly but.

On the spreadsheet I am setting the alignment on some cells and using a text orientation of -45 degrees. This is not carried over to the picture, but instead results in a picture showing those cells without the -45 degrees alignment. Then if you click on this it displays the spreadsheet correctly. But if you then click out of the spreadsheet it loads the spreadsheet but now the alignment of those cells is correct but the wording in those cells is off.

David

Hi David,


I am sorry for the delayed response.

I regret to share that I have not been able to observe the issue on my end. Can you please share the issue in the form of snapshots by mentioning different stages where by you have been able to observe the issue. Please also share the source presentation, source excel file along with the code snippet that you have used on your end. I will try to reproduce the issue on my end.

We are sorry for your inconvenience,

Mudassir,

I enclosed the spreadsheet that was created by using your code examples in the earlier post. At this point I have decided to pursue using the slides/tables instead of embedding the excel spreadsheets.

Dave

Hi Dave,


That is also appreciable that you have opted to use Aspose.Slides tables. Please share, if I may help you further for tables.

Many Thanks,