Pivot table and it's macro

  • Thread starter Thread starter Braiock
  • Start date Start date
B

Braiock

I am creating a table and from the table a pivot table using a macro. When I
run the macro the table gets created without a problem but when it goes to
create the pivot table I get an error and the debugger highlights this
section:

ActiveWorkbook.PivotCaches.Create(SourceType:=xlDatabase, SourceData:= _
"Table8", Version:=xlPivotTableVersion12).CreatePivotTable
TableDestination _
:="Perf Tables!R2C8", TableName:="PivotTable1", DefaultVersion:= _
xlPivotTableVersion12

Can anyone see where the problem is happening?
 
My guess is that a pivot table already exists at that location or a pivot
table already exists with that name "PivotTable1". Change the location and
name of the pivot table being created or delete the old pivot table before
running this macro.
 
Back
Top