none
[Excel][PowerPoint]How to refresh excel chart copied&pasted from Excel file RRS feed

  • Question

  • I'm developing a PowerPoint add-in that enables users to insert complicated chart that can not be easily generated such as waterfall chart, marimekko, and so on.

    Such chart requires some preproccess to generate a source for chart, and post-process to format the chart.

    So, I consider the chart generation process like bellow,

    1. prepare template excel to generate chart(a).
    2. invoke an Excel sheet(b) for user to input data.
    3. copy data from (b) to (a)
    4. copy generated chart back from (a) to (b)

    code for 4. is bellow

    Excel.ChartObject chartObject = Worksheet.ChartObjects("Chart 2");
                    chartObject.Copy(); 
                });
    
    PowerPoint.Application powerPointApp = new PowerPoint.Application();
    PowerPoint.Slide slide = powerPointApp.ActiveWindow.View.Slide;
    PowerPoint.ShapeRange shapeRange = slide.Shapes.PasteSpecial();
          

    This works fine once, but chart inside PowerPoint doesn't change on changing data inside (b).

    How can I refresh chart inside PowerPoint chart?



    • Edited by XiphiasG Friday, October 11, 2013 9:35 AM
    Friday, October 11, 2013 9:31 AM

Answers

  • Hi XiPhiaG,

    The chart in powerpoint is linked the excel chart.

    Make sure your linked excel file is avaliable,then if you change data in excel ,the chart will refreash automatically.

    if you want change the chart in powerpoint, you can only change the data in excel .

    Regards,

    Tuesday, October 15, 2013 12:51 PM

All replies

  • Try the excel command of ActiveWorkbook.RefreshAll

    Kind Regards, Rich ... http://greatcirclelearning.com

    Friday, October 11, 2013 10:06 AM
  • As long as the application that opens excel file with chart is active, chart is updated fine without calling RefreshAll.

    But I want update the chart inside powerpoint without activating the excel file.

    Unfortunately, calling RefreshAll of Workbook object which has chart doesn't update chart inside powerpoint.

    Tuesday, October 15, 2013 8:07 AM
  • Hi XiPhiaG,

    The chart in powerpoint is linked the excel chart.

    Make sure your linked excel file is avaliable,then if you change data in excel ,the chart will refreash automatically.

    if you want change the chart in powerpoint, you can only change the data in excel .

    Regards,

    Tuesday, October 15, 2013 12:51 PM