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