Support of External Workbook

Create External Workbook

This article demonstrates how to create an external workbook from scratch using Aspose.Slides. ReadWorkbookStream() and SetExternalWorkbook() methods can be used to create an external workbook from scratch or to make an internal workbook external.

The implementation is demonstrated below in an example.

Set External Workbook

Using Aspose.Slides, an external workbook can be assigned to a chart as a data source. For this purpose SetExternalWorkbook() method has been added.

SetExternalWorkbook() method can be also used to update a path to the external workbook if it has been moved. Workbooks placed on remote resources unavailable for data editing but still can be assigned as an external data source. If the relative path was provided for an external workbook, it converts to full path automatically.

The implementation is demonstrated below in an example.

The SetExternalWorkbook(System::String workbookPath, bool updateChartData) method has been added with updateChartData parameter to the ChartData and IChartData classes.

The updateChartData parameter defines whether an excel workbook will be loaded or not. If the value is false only the workbook path will be updated. Chart data will not be loaded and updated from the target workbook. This is useful when the target workbook does not yet exist or is not available. If the value is true chart data will be updated from the target workbook as the SetExternalWorkbook(System::String) method does.

Edit Chart Data

Using Aspose.Slides, Chart data in external workbooks can be edited the same way it works for internal workbooks. If external workbook cannot be loaded an exception is thrown.

The implementation is demonstrated below in an example.