Thursday, 13 September 2012

C# - Excel - Error Cannot implicitly convert type 'Microsoft.Office.Interop.Excel.PivotCaches' to 'Microsoft.Office.Interop.Excel.PivotCache'. An explicit conversion exists (are you missing a cast?)

Cannot implicitly convert type 'Microsoft.Office.Interop.Excel.PivotCaches' to 'Microsoft.Office.Interop.Excel.PivotCache'. An explicit conversion exists (are you missing a cast?)   

Replace
        Excel.PivotCache oPivotCache = oBook.PivotCaches();
with
 Excel.PivotCache oPivotCache = (Excel.PivotCache)oBook.PivotCaches();

No comments:

Post a Comment