SetExternalWorkbook
SetExternalWorkbook(string)
Sets external workbook as a data source for the chart. Chart data will be updated from the target workbook.
public void SetExternalWorkbook(string workbookPath)
Parameter | Type | Description |
---|
workbookPath | String | Path to the target workbook |
Exceptions
exception | condition |
---|
InvalidOperationException | External workbook is not available or can’t be loaded. |
Examples
[C#]
using (Presentation pres = new Presentation())
IChart chart = pres.Slides[0].Shapes.AddChart(ChartType.Pie, 50, 50, 400, 600, true);
IChartData chartData = chart.ChartData;
(chartData as ChartData).SetExternalWorkbook("../../workbook.xlsx");
See Also
SetExternalWorkbook(string, bool)
Sets external workbook as a data source for the chart.
public void SetExternalWorkbook(string workbookPath, bool updateChartData)
Parameter | Type | Description |
---|
workbookPath | String | Path to the target workbook |
updateChartData | Boolean | If value is false only workbook path will be updated. Chart data won’t be loaded and updated from the target workbook. Can be used when target workbook doesn’t exist or it’s not available. If value is true chart data will be updated from the target workbook. |
Exceptions
exception | condition |
---|
InvalidOperationException | External workbook is not available or can’t be loaded. |
Examples
using (Presentation pres = new Presentation())
IChart chart = pres.Slides[0].Shapes.AddChart(ChartType.Pie, 50, 50, 400, 600, true);
IChartData chartData = chart.ChartData;
(chartData as ChartData).SetExternalWorkbook("http://path/doesnt/exists", false);
See Also