I am trying to create pivot table in VBA and getting the error as Invalid Procedure call or argument, while calling the Pivot table creation function
Attached my workbook
On which line do you get the error? Your code runs OK for me, though I would note that it is safer to use the address of the source range rather than a range object as the source data for your pivot cache.
On which line do you get the error? Your code runs OK for me, though I would note that it is safer to use the address of the source range rather than a range object as the source data for your pivot cache.
I can't reproduce that in your file. Which version of Excel are you running it in when the error occurs? If it's pre 2016, you'd get that error because of the Version parameter.
I can't reproduce that in your file. Which version of Excel are you running it in when the error occurs? If it's pre 2016, you'd get that error because of the Version parameter.