Hello.
I use PowerPoint VSTO add-in to redirect charts to another Excel source.
I fill some range in Excel file, create a chart and copy it in PowerPoint presentation. Then I find chart just copied and execute the following code:
oShape.Chart.SetSourceData(source, Type.Missing);
oShape.Chart.Refresh();
Where "source" variable looks like this
string source = @"='C:\Path\To\File\[MyBOOK.xlsx]Sheet1'!$L$16";
It works only if I have both PowerPoint and Excel applications in opened state from copiyng chart till executing SetSourceData method. This way doesn't work if I close Excel and even if I then will reopen Excel again. Closing and opening PowerPoint also breaks
a work.
How can I make Chart.SetSourceData() method works in case of closing Excel or PowerPoint? Or is there another way to redirect PowerPoint chart to another Excel source? Maybe through OpenXML api?
Thanks, Mikhail.