Folks, I have some code in a maacro that has been working beautifully, but just recently started to blow up on me. The code that is off is as follows:
The error message I am getting says "Runtime error '5': Invalid procedure call or argument". I don't know enough avout VBA to know what part of the code is causing this error, therefore I don't know what to fix.
Would appreciate some help on this. Thanks!
Code:
ActiveWorkbook.PivotCaches.Create(SourceType:=xlDatabase, SourceData:= _
"Count_Employees_by_Div_Type_W__!R1C1:R1133C6", Version:= _
xlPivotTableVersion14).CreatePivotTable TableDestination:="Sheet1!R3C1", _
TableName:="PivotTable4", DefaultVersion:=xlPivotTableVersion14
Would appreciate some help on this. Thanks!