I've tried all the solutions recommended in other posts, but still can't get this pivot table to run in my macro. Its a simple pivot table. It comes from a worksheet where I want to be able to dump data in the future to create weekly headcount reports. Here is the highlighted coded when I click on the debugger. Any suggestions?
ActiveWorkbook.PivotCaches.Create(SourceType:=xlDatabase, SourceData:= _
"Headcount!R1C1:R1048576C12", Version:=6).CreatePivotTable TableDestination _
:="Sheet11!R3C1", TableName:="PivotTable9", DefaultVersion:=6
ActiveWorkbook.PivotCaches.Create(SourceType:=xlDatabase, SourceData:= _
"Headcount!R1C1:R1048576C12", Version:=6).CreatePivotTable TableDestination _
:="Sheet11!R3C1", TableName:="PivotTable9", DefaultVersion:=6