RecoverWorkbookFromChartCache

ISpreadsheetOptions.RecoverWorkbookFromChartCache 属性

如果图表的数据源是一个外部工作簿且不可用,则将从图表缓存中恢复它。

public bool RecoverWorkbookFromChartCache { get; set; }

异常

异常条件
InvalidOperationException当外部工作簿不可用且 RecoverWorkbookFromChartCache 属性值为 false 时抛出。

示例

示例:

[C#]
LoadOptions loadOptions = new LoadOptions
{
    SpreadsheetOptions = new SpreadsheetOptions
    {
        RecoverWorkbookFromChartCache = true
    }
};

using (Presentation pres = new Presentation("Presentation.pptx", loadOptions))
{
    IChart chart = pres.Slides[0].Shapes[0] as IChart;
    IChartDataWorkbook recoveredWorkbook = chart.ChartData.ChartDataWorkbook;
}

另请参阅