Hi guys,
I am trying to build a macro for the creation of pivot tables. Since I am very new to excel, i cannot code this myself and have resorted to using the macro recorder.
However, after i have recorded my macro and i try to run it i get the following error:
Run-time error '5'
Invalid procedure call or argument
In the debugger, this portion of the code is highlighted(it is right at the top):
![]()
ActiveWorkbook.PivotCaches.Create(SourceType:=xlDatabase, SourceData:= _ "Graydon-TL!R1C1:R15507C17", Version:=xlPivotTableVersion14). _ CreatePivotTable TableDestination:="Sheet3!R1C1", TableName:="PivotTable4" _ , DefaultVersion:=xlPivotTableVersion14
Would anyone please be able to explain how I should go about fixing this?
What I am doing doesnt even seem to complex. I simply start the recorder, hit insert pivot chart, set up the correct fields in the pivot table, fix up the pivot chart type and then I stop recording.
Any help, tips or pointers would be greatly appreciated!
Cheers,
Nima
Bookmarks