PivotTable error

I have read all the forums on pivot table but I still do not understand how I can do it… I tried to implement the invoke code from Create Pivot table using UIPATH - #3 by sanjay21051990 but I have encountered this error
image

is there something wrong with this code?
Dim oPivotCache As Microsoft.Office.Interop.Excel.PivotCache=Nothing
Dim oPivotTables As Microsoft.Office.Interop.Excel.PivotTables=Nothing
Dim oPivotTable As Microsoft.Office.Interop.Excel.PivotTable=Nothing

oPivotCache=CType(wb.PivotCaches().Add(Microsoft.Office.Interop.Excel.XlPivotTableSourceType.xlDatabase,rng),Microsoft.Office.Interop.Excel.PivotCache)
oPivotTables=DirectCast(p_ws.PivotTables(Type.Missing),Microsoft.Office.Interop.Excel.PivotTables)
oPivotTable=oPivotTables.Add(oPivotCache,p_rng,“Summary”,Type.Missing,Type.Missing)’

Check this Create Pivot table using UIPATH - #3 by sanjay21051990

thank you but I already did! I have downloaded the project you attached and it runs perfectly but when I went to replace the location of my file, the range, and the row to follow my excel but I encountered that error…

Could you please attach your project file?