This project has moved. For the latest updates, please go here.

Error saving when pivot table uses named range that has workbook scope


When I save a spreadsheet that has a pivot table that uses a named range that has workbook scope I get an error in ExcelWorksheet.savePivotTables().
var ws = Workbook.Worksheets[pt.CacheDefinition.SourceRange.WorkSheet];
pt.CacheDefinition.SourceRange.WorkSheet is null.

Pivot tables save fine if the named range has a worksheet scope. A work around is having to use multiple named ranges. The only issue is that Excel cannot cope with two named ranges that have exactly the same range.