IChartDataSetExternalWorkbook Method (String)

Sets external workbook as a data source for the chart. Chart data will be updated from the target workbook.

Namespace:  Aspose.Slides.Charts
Assembly:  Aspose.Slides (in Aspose.Slides.dll) Version: 22.4.0.0 (22.4)
Syntax
void SetExternalWorkbook(
	string workbookPath
)

Parameters

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