P
PE
I have recorded a macro (using relative references) which creats a pivot
table but when I run it I get a runtime error 5 and on clicking debug the
second line/paragraph is highlighted:
Sheets.Add
ActiveWorkbook.PivotCaches.Create(SourceType:=xlDatabase, SourceData:= _
"Unpaid Invoices (2)!R2C1:R164C5", Version:=xlPivotTableVersion12).
_
CreatePivotTable TableDestination:="Sheet2!R3C1",
TableName:="PivotTable1" _
, DefaultVersion:=xlPivotTableVersion12
I don't know what is causing the macro to breakdown immediately after
creating a new sheet.
Would appreciate your help.
table but when I run it I get a runtime error 5 and on clicking debug the
second line/paragraph is highlighted:
Sheets.Add
ActiveWorkbook.PivotCaches.Create(SourceType:=xlDatabase, SourceData:= _
"Unpaid Invoices (2)!R2C1:R164C5", Version:=xlPivotTableVersion12).
_
CreatePivotTable TableDestination:="Sheet2!R3C1",
TableName:="PivotTable1" _
, DefaultVersion:=xlPivotTableVersion12
I don't know what is causing the macro to breakdown immediately after
creating a new sheet.
Would appreciate your help.