none
Embed Excel Sheet into Powerpoint Slide using Open XML SDK 2.5 RRS feed

  • Question

  • Hello All,

    I am trying to embed an excel worksheet into a powerpoint slide using the Open XML SDK 2.5.  I used the SDK Productivity tool and was able to reflect most of the code to make this work, but I've run into an issue regarding the height and width of the inserted object.

    To duplicate the code, open a blank presentation, insert an object choose excel binary, 'from file' and pick an excel file (not linked).

    This will:

    • Create an EmbeddedPackagePart tied to the SlidePart
    • Create a VmlDrawingPart tied to the SlidePart
    • Create an ImagePart tied to the VmlDrawingPart
    • Associate the ImagePart to the slide
    • Create and add a GraphicFrame to the shape tree
    • Create a Graphic and GraphicData with AlternateContent elements
    • Create OleObject and OleObjectEmbed elements associated to the alternate content elements
    • Create a Picture and BlipFill (and associated stuff) with the same rId as the ImagePart slide associate rId above

    When I generate a new table picture from my table to use a preview, the dimensions are different than the reflected code, and so when I change the various Offset and Transform elements to match my calculated height and width (in EMUs), it breaks the embedding.  It creates a Picture AND an ole frame.  However, if I don't touch the extents or offsets, it all works perfectly.

    I suspect it is a relational thing where the Vml shape has to have the same exact height/width/top/left as the ole object, but I'm having trouble getting an accurate conversion from EMU (used by powerpoint) to points (used by vml)

    I am at a complete loss on this and was hoping someone else who understands this more than I can help... any suggestions?

    Thanks

    Chadwick Posey


    Tuesday, March 18, 2014 6:20 PM

All replies

  • Hi Chadwick Posey,

    Could you provide a simplified example for us to reproduce the issue? a compressed file would be fine.
    so as to we can have a clear idea of figuring out the issue.

    Regards,


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Thursday, March 20, 2014 5:31 AM
    Moderator