Getting Run time Error 5 when updating a Pivot Table

Sahar24

New Member
Joined
Jan 19, 2014
Messages
1
I am trying to update a pivot table. The following code works on my computer but on my colleague's computer displays-Run time error 5- invalid procedure call or argument. The error accurs on .ChangePivotCache line

Code:
Sheets("DB for ECO Qty").Activate
LastRow = Cells(Rows.Count, 1).End(xlUp).Row

Sheets("ECO Qty over time Graph").Activate


DataArea = "DB for ECO Qty!R1C1:R" & LastRow & "C19"
Range("B4").Select
Application.DisplayAlerts = False


ActiveSheet.PivotTables("PivotTable1").ChangePivotCache ActiveWorkbook. _
PivotCaches.create(SourceType:=xlDatabase, SourceData:=DataArea, _
Version:=xlPivotTableVersion14)


Application.DisplayAlerts = True
 

Excel Facts

How to show all formulas in Excel?
Press Ctrl+` to show all formulas. Press it again to toggle back to numbers. The grave accent is often under the tilde on US keyboards.
Hi, Sahar24,

does this colleague have Excel2010 or Excel2013 installed on the computer? Version:=xlPivotTableVersion14 requires these versions AFAIK.

Ciao,
Holger
 
Upvote 0

Forum statistics

Threads
1,223,247
Messages
6,171,007
Members
452,374
Latest member
keccles

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top