0
Worksheet ws = (Worksheet)pivotTableWorkBook.Worksheets.Item[1];

Range pivotData = ws.Range["A1:N82009"];
Range pivotDestination = ws.Range["Q4"];
string pivotTableName = "Call Cycle Pivot Table";
PivotCache pivotCache = pivotTableWorkBook.PivotCaches().Add(XlPivotTableSourceType.xlDatabase, pivotData);
//PivotTable pivotTable = ws.PivotTables().Add(pivotTableName, pivotDestination, pivotCache);
PivotTable pivotTable = ws.PivotTables().Add( pivotTableName, pivotDestination, pivotCache);

I was creating a pivot table through Selenium Csharp, but suddenly I encountered this error. Tried a lot to fix it but failed. Please help me to solve this. The code which I shown above is Microsoft interop

  • What kind of code is this? VBA? Microsoft interop? Third party (such as EPPlus)? – topsail May 11 '23 at 20:01
  • looks like it takes 5 arguments: https://learn.microsoft.com/en-us/dotnet/api/microsoft.office.interop.excel.pivottables.add?view=excel-pia#microsoft-office-interop-excel-pivottables-add(microsoft-office-interop-excel-pivotcache-system-object-system-object-system-object-system-object) – pcalkins May 11 '23 at 23:12
  • Can you please tell me what should be the remaining 2 arguments – Aryan Arjun P K May 12 '23 at 08:19

0 Answers0