RecoverWorkbookFromChartCache Spreadsheet Load Option Is Not Working in C#

Aspose.Slides.NET 23.1.0

When a chart embedded on a slide has a link to a file hosted at an inaccessible URL rather than in the local file system, attempting to read from the chart data causes an InvalidOperationException with an inner WebException containing the http status code such as (403, 404 etc) despite using the RecoverWorkbookFromChartCache spreadsheet load option documented here.

The following code can be used to reproduce the error,

void Main()
{
    var loadOptions = new LoadOptions { SpreadsheetOptions = new SpreadsheetOptions { RecoverWorkbookFromChartCache = true };
    using var presentation = new Presentation(loadOptions);
    var chart = presentation.Slides[0].Shapes.AddChart(ChartType.Pie, 50, 50, 400, 600);
    chart.ChartData.SetExternalWorkbook("https://example.com/example.xlsx", false);
    var workbook = chart.ChartData.ChartDataWorkbook;
}

The same issue occurs when loading from PPTX file.

I have been able to make RecoverWorkbookFromChartCache work in this scenario by setting the external workbook to an invalid file path URI instead, using, chart.ChartData.SetExternalWorkbook("file:///should-not.exist", false);

I believe the above workaround shouldn’t be necessary when using RecoverWorkbookFromChartCache.

@publishinteractive,
Thank you for reporting the issue. I reproduced the problem with the RecoverWorkbookFromChartCache property.

We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): SLIDESNET-43800

You can obtain Paid Support services if you need support on a priority basis, along with the direct access to our Paid Support management team.