IChartDataSetExternalWorkbook Method (String, Boolean)

Sets external workbook as a data source for the chart.

Namespace:  Aspose.Slides.Charts
Assembly:  Aspose.Slides (in Aspose.Slides.dll) Version: 22.5.0.0 (22.5)
Syntax
void SetExternalWorkbook(
	string workbookPath,
	bool updateChartData
)

Parameters

workbookPath
Type: SystemString
Path to the target workbook
updateChartData
Type: SystemBoolean
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
ExceptionCondition
InvalidOperationExceptionExternal 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