none
OpenXML embed Excel OLE object in word document RRS feed

  • Question

  • Hi team,

    We are generating excel 2003/2007 reports at server side and we need to embed them in word document. We referred below MSDN blogs to achieve it.

    http://blogs.msdn.com/b/brian_jones/archive/2009/06/30/embedding-an-open-xml-file-in-another-open-xml-file.aspx

    As well we used Open XML SDK tool to modify code as per need.

    When we embed image it inserts as per scale, but on double click image size is change due to OLE object height and width. The OLE object height and width is not same as of image. In above video also behavior is same. In video he has to change the excel OLE object’s dimensions manually. We need to achieve height and width adjustment through code using Open XML 2.0.

    We have inserted document with excel embedded manually and programmatically generated document.  Below are the sample code and documents generated.

    If you need more clarification on issue I can send you document which has details of code and XML comparison and code via email/ upload it.

    Thanks in advance.

    Regards,

    Nakul

     


    Regards, Nakul
    Thursday, September 22, 2011 6:07 AM

Answers

All replies

  • Hi,

    You can find document and code here

    https://skydrive.live.com/redir.aspx?cid=ee922e8d8530952f&resid=EE922E8D8530952F!157

     

     


    Regards, Nakul
    Thursday, September 22, 2011 7:28 AM
  • Hi Nakul,

    I'm looking into this for you.  I'll get back to you shortly with an answer.

    Best regards,
    Tom Jebo
    Escalation Engineer
    Microsoft Open Specifications

    Friday, September 30, 2011 7:41 PM
    Moderator
  • Ok Tom,

    Thanks,

    Nakul


    Regards, Nakul
    Tuesday, October 4, 2011 8:29 AM
  • Hi Nakul,

    thanks for your patience.  I think the only way to have the presentation cache image size match what shows after inplace activation, would be to use the image from another document that has already activated the same document.  You'll notice that after activation, the image for the presentation cache shows up in the relationship part of the document and that the extents are updated to match what was negotiated during inplace activation. 

    Tom

    Monday, October 10, 2011 4:58 PM
    Moderator
  • We are using the Open Xml SDK v2 in order to do so.  The xlsx documents get attached nicely to the docx file however when we double click on the embedded attachments icon, and after we close the attachment, its icon (the image associated to the embedded file) shrinks.  This happens only if we generate the document in a computer with Office 2007 installed.  If we generate the documents in a computer with Office 2010 installed the embedded attachments icons don't shrink (even if we open them at the computer with Office 2007).  Any thoughts about this?

    Tuesday, October 11, 2011 3:29 AM
  • Thanks Johann,

    I'll look into this but upon initial reflection, I'm not sure this is actually a problem with the OOXML elements or attributes but instead a behaviour issue in Office 2007.  The handlers may be updated with Office 2010 which is why you don't see the icon shrinkage.

    One thing I'd try first (but don't have it setup at the moment and apparently you do) is just linking or embedding two documents via the UI with Office 2007 only install (i.e. don't create the OOXML file programmatically).  If the shrinkage still shows up then you're probably doing nothing wrong in creating the OOXML.  In that case, you might post the question to Excel IT Pro Discussions.

    If it's only a problem with your programmatically created file, send me the files you're working with.  You can send them to dochelp at Microsoft dot com, referencing my name and the URL for this thread.

    Tom 

    Tuesday, October 11, 2011 4:52 PM
    Moderator
  • Johann,

    Did you try my suggestions?  Just wondering what you found.

    Tom

    Monday, October 24, 2011 8:31 PM
    Moderator
  • Nakul,

    I haven't seen a response to this issue via either dochelp or this forum thread. Was it resolved? I’m going to close this on our end. But, if this still requires attention, please contact us.

    Tom

    Friday, December 2, 2011 11:28 PM
    Moderator
  • Hi,

    I have the same problem embedding a spreadsheet in a PowerPoint document with Open XML. Double-click on the image for editing, the embedded object appears with a different size and position.

    Any solution?

    Thanks!

    Monday, April 2, 2012 2:37 PM
  • Hi Keltibero,

    You should post this question to Excel IT Pro Discussions.  This is a behaviour specific to Excel and Powerpoint implementations and not related to the standard.

    Best regards,
    Tom Jebo
    Escalation Engineer
    Microsoft Open Specifications

    Monday, April 2, 2012 2:51 PM
    Moderator
  • Ok Tom,

    I thought my problem was perfectly related to the topic of this thread...sorry!

    Monday, April 9, 2012 2:34 PM
  • Nakul,

    You ever come up with a solution for this?  I'm running into the same issue of wanting to specify the viewable columns/rows when the user activates the embedded excel object that I've embedded into a word document using OpenXML, instead of accepting the default A1:E10 view that is automatically coming up for my embedded excel spreadsheet and depending on the user to correctly resize the activated viewport to include the correct columns and rows.

    So, how'd you solve this?

    Thanks,
    Stephen


    Stephen Study


    Tuesday, April 24, 2012 3:38 PM
  • Hello Stephen Study,

    Thank you for your inquiry about Open XML protocols. One of the Open specifications team member will contact you soon. In future, please post your question in a new thread as it helps track the progress  better.

     
    Regards,
    Sreekanth Nadendla
    Microsoft Windows Open specifications

    Tuesday, April 24, 2012 4:06 PM
    Moderator
  • Hi Stephen,

    I’ll allow Nakul to respond regarding how he resolved his problem.  The Open Specifications are correct and therefore, there isn’t anything more I can add from that perspective.  The problem is between Excel and Word and within their negotiation.  You might also try posting/searching on the Excel IT Pro, Word IT Pro and Office IT Pro forums on technet.

    Best regards,
    Tom Jebo
    Escalation Engineer
    Microsoft Open Specifications

    Wednesday, April 25, 2012 8:34 PM
    Moderator
  • Hi Keltiero,

    Are you still facing this issue.

    Could you please share the solution?

    I will correct and send back the solution.

    Thanks and regards,

    Nakul


    Regards, Nakul

    Friday, May 11, 2012 2:00 PM
  • Hello Stephen,

    I am wondering whether you have ever received any suport directing you to solving the problem with opening the spreadsheets embedded to word documents using OpenXML by default in A1:E10 range instead of the visible area?

    Best regards,

    Piotr

    Friday, November 13, 2015 12:36 AM
  • Hi,

    How to solve the problem Stephen Study and Nakul reported?

    Friday, November 13, 2015 12:36 AM