Free Support Forum - aspose.com

Slides OleObjectFrame to Office Interop OleObject

I have a Slides license, but I need to embed part of a slide into an Excel file through automation (I don't have Cells).

Questions: How can I do this? Do I need to write it to file and import it back when I create the OleObject? Isn't there a more direct way to do this?
—an explicit cast would be really useful.

Hi,

You can write the desired shapes (Parts) of the slide to a file and then use Excel macros to embed oleobject.

There is no Excel file, I'm building it...

What options do you see? —using Excel macros is not an option.

Hello,

You can save presentation to a file or MemoryStream. But I’m not sure if adding OLE object from a stream is supported through Excel automation.

What you mean “embed part of a slide”? Embed part of a presentation? One slide? Several shapes from one slide?

Well, I was hoping that I could someway either
1. cast OleObjectFrame (or a property) into an Office Interop OleObject, or
2. cast the Slide/Shapes representation into an Office Interop supported type,
but it doesn't seem to be the case.

So in order for me to use the objects I already have in memory with automation I need to write it to file an import it back, right? —which is what I'm doing now.

Oh, and I meant to embed (many) shapes from a slide (1-slide presentation) into an Excel file. Unfortunately, I can't use images, so OLE objects are pretty much my only choice.

Yes, I think you have to store presentation to a file. For details about Office Interop functionality please refer to the MSDN. We don’t use it and can’t help.