Hello,
I am getting the error message: "Run-time error 5" : Invalid call procedure or argument when running this script:
Sheets("Usage Report").Select
Range("A2").Select
ActiveWorkbook.PivotCaches.Create(SourceType:=xlDatabase, SourceData:= _
"Usage Report!R1C1:R286C7", Version:=xlPivotTableVersion12).CreatePivotTable _
TableDestination:="Usage Report!R2C8", TableName:="PivotTable6", _
DefaultVersion:=xlPivotTableVersion12
Sheets("Usage Report").Select
Cells(2, 8).Select
With ActiveSheet.PivotTables("PivotTable6").PivotFields("Identifier")
.Orientation = xlRowField
.Position = 1
End With
ActiveSheet.PivotTables("PivotTable6").AddDataField ActiveSheet.PivotTables( _
"PivotTable6").PivotFields("Identifier"), "Count of Identifier", xlCount
With ActiveSheet.PivotTables("PivotTable6").PivotFields("Type")
.Orientation = xlColumnField
.Position = 1
End With
End Sub
Any help would be greatly appreciated. Thanks
I am getting the error message: "Run-time error 5" : Invalid call procedure or argument when running this script:
Sheets("Usage Report").Select
Range("A2").Select
ActiveWorkbook.PivotCaches.Create(SourceType:=xlDatabase, SourceData:= _
"Usage Report!R1C1:R286C7", Version:=xlPivotTableVersion12).CreatePivotTable _
TableDestination:="Usage Report!R2C8", TableName:="PivotTable6", _
DefaultVersion:=xlPivotTableVersion12
Sheets("Usage Report").Select
Cells(2, 8).Select
With ActiveSheet.PivotTables("PivotTable6").PivotFields("Identifier")
.Orientation = xlRowField
.Position = 1
End With
ActiveSheet.PivotTables("PivotTable6").AddDataField ActiveSheet.PivotTables( _
"PivotTable6").PivotFields("Identifier"), "Count of Identifier", xlCount
With ActiveSheet.PivotTables("PivotTable6").PivotFields("Type")
.Orientation = xlColumnField
.Position = 1
End With
End Sub
Any help would be greatly appreciated. Thanks