Error code '5' Creating Pivot Table

New Contributor

Hello, I am making a macro that does some basic calculations on a long list of data and one of the steps is to make a pivot table. When I use my own laptops, it works. When my coworkers (who are on a company excel or business related) try to run the macro, the system doesn't work.  I then get a run time error on the line of code that is assigned to the pivot table creation. And I already checked to make sure I am spelling everything correct. 

----------------

ActiveWorkbook.PivotCaches.Create(SourceType:=xlDatabase, SourceData:= _
"PivotCleanData!R1C1:R1048576C9", Version:=8).CreatePivotTable _
TableDestination:="TableDestination!R3C1", TableName:="PivotTable", _
DefaultVersion:=8 

--------------------

I even tried using variables to refer to the sheets that create the pivot table. No good. 

0 Replies