- Code: Select all
/*get slide form existing presentation*/
ISlide slide = presentation.Slides[1];
/*load chart from slide shapes*/
IChart chart = slide2.Shapes[3] as IChart;
Double[] xdata = new Double[] { 7.7, 8.9, 1.0, 2.4 };
Double[] ydata = new Double[] { 15.2, 5.3, 6.7, 8 };
Double[] size = new Double[] { 1.1, 2.4, 3.7, 4.8 };
/*update existing chart data values in excel*/
for (Int32 i = 0; i < xdata.Length; ++i)
{
chart.ChartData[i + 1, 0].Value = xdata[i];
chart.ChartData[i + 1, 1].Value = ydata[i];
chart.ChartData[i + 1, 2].Value = size[i];
}
After Updating values when I opened PowerPoint and clicked on edit data of the chart.
I am facing below error.
"The linked file isn't available. This error can occur if the linked file has been moved or hasn't been saved. Embedding the data instead of linking it can help avoid this error, but the data won't be updated automatically if it changes in the source file."