• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Runtime Error 5 : Invalid procedure call or argument

Hi Pals

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

Kindly help
 

Attachments

  • PivotAutomation.xlsm
    22.2 KB · Views: 4
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.
 
Back
Top