Pivot table and it's macro

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?
 
T

tompl

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top