I didn't think this was going to be hard, but, i'm trying to set up a pivot chart using VBA, so I recorded a Macro, but now even when I try to use that same macro I get the "Run-time error '5':
Invalid procedure call or argument

I just think it's weird that I get that after recording a macro and not changing anything, but maybe someone could help me with this. Here is what the recording comes up with:

Sub Macro7()

ActiveWorkbook.PivotCaches.create(SourceType:=xlDatabase, SourceData:= _
"ICS-GSD-Account Management!R2C1:R1106C8", Version:=xlPivotTableVersion10). _CreatePivotTable TableDestination:="ICS-GSD-Account Management!R2C9", _
TableName:="PivotTable10", DefaultVersion:=xlPivotTableVersion10
Sheets("ICS-GSD-Account Management").Select
Cells(2, 9).Select
ActiveSheet.Shapes.AddChart.Select
ActiveChart.SetSourceData Source:=Range( _
"'ICS-GSD-Account Management'!$I$2:$O$15")
ActiveChart.ChartType = xlColumnClustered
End Sub



When I run the macro, the error comes up for the first part:

ActiveWorkbook.PivotCaches.create(SourceType:=xlDatabase, SourceData:= _
"ICS-GSD-Account Management!R2C1:R1106C8", Version:=xlPivotTableVersion10). _
CreatePivotTable TableDestination:="ICS-GSD-Account Management!R2C9", _
TableName:="PivotTable10", DefaultVersion:=xlPivotTableVersion10

But I can't really tell what's wrong in there.

Eventually i want to adapt this so that it runs through each of the sheets in my workbook, but I can't even get this initial code to work. Any hlep that you have would be great