none
excel chart to word RRS feed

  • Question

  • Hi,

    I have an excel file that has one worksheet and one chartsheet (with a chart defined), such that when I enter in values in the worksheet and switch to the chart sheet the chart changes. I then want to copy this chart to a word document.

    I am trying to achieve this through the SDK. Here is the sequence of events.

     

    1. Use the SDK to populate the cell values in a worksheet and save it (one would assume that the graph is also updated).

    2. Use the SDK to copy the chart from the excel to a word document.

     

    Now when I open the word document the chart is copied, but it is blank.... not updated..... What could be the reason for this? Is there anyway to activate the chart without actually having to open it up in excel?

     

    -abe

     

     

     

    Monday, June 7, 2010 6:14 AM

Answers

  • Thanks Ji for the quick reply. Actually both the problems are the same. The difference between the two is that in the first case (earlier post) I was trying to embed a excel sheet into word and in this case I was trying to embed a excel chart into word. 

    Like you pointed out, the update of the data (either the chart or the excel table) takes place in excel but unfortunately the rendering does not take place when you open word (it gets it from the internal cache that word stores). This is not a problem with Open XML SDK 2.0, but more of a lack of functionality on the word application side.

     

    One possible way I found out to solve the problem is to link the excel sheet or chart instead of embedding it as a whole. This works great except for the fact that when you open the word document using word 2007 application, you get an ugly pop-up saying "This document contains links that may refer to other files. Do you want to update this document with the data from the linked files?".

    I have found no way to suppress this dialog box.... Other than this pop-up problem embedded links works great.

     

    -abe

    Tuesday, June 8, 2010 10:19 PM

All replies

  • Hello Abe,

    Is this the same discussion here,

    http://social.msdn.microsoft.com/Forums/en-US/oxmlsdk/thread/3cd01648-4212-4544-a64e-9f2e88ca85e5

    If not, could you please post the codes you are using in the forum. So I can try to reproduce the issue in my side and investigate locally.

     

    Best regards,

    Ji Zhou

    MSDN Subscriber Support in forum


    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Tuesday, June 8, 2010 1:16 PM
    Moderator
  • Thanks Ji for the quick reply. Actually both the problems are the same. The difference between the two is that in the first case (earlier post) I was trying to embed a excel sheet into word and in this case I was trying to embed a excel chart into word. 

    Like you pointed out, the update of the data (either the chart or the excel table) takes place in excel but unfortunately the rendering does not take place when you open word (it gets it from the internal cache that word stores). This is not a problem with Open XML SDK 2.0, but more of a lack of functionality on the word application side.

     

    One possible way I found out to solve the problem is to link the excel sheet or chart instead of embedding it as a whole. This works great except for the fact that when you open the word document using word 2007 application, you get an ugly pop-up saying "This document contains links that may refer to other files. Do you want to update this document with the data from the linked files?".

    I have found no way to suppress this dialog box.... Other than this pop-up problem embedded links works great.

     

    -abe

    Tuesday, June 8, 2010 10:19 PM