Hi I dont know why this error coming while creating pivot table.
I have used datasource as rng, and rng is caluculated this way
last_row = Range("A" & Rows.Count).End(xlUp).Row
last_col = Range("XFD1").End(xlToLeft).Column
Set rng = Range(Cells(1, 1), Cells(last_row, last_col))
ActiveWorkbook.PivotCaches.Create(SourceType:=xlDatabase, SourceData:= _
rng, Version:=xlPivotTableVersion12).CreatePivotTable _
TableDestination:="data!R3C1", TableName:="PivotTable1", DefaultVersion _
:=xlPivotTableVersion12
It is working fine from last two years but suddenly it is showing this error while running macro.
" Method 'CreatePivotTable' of object 'PivotCache' failed."
Please help me on this issue.
I have used datasource as rng, and rng is caluculated this way
last_row = Range("A" & Rows.Count).End(xlUp).Row
last_col = Range("XFD1").End(xlToLeft).Column
Set rng = Range(Cells(1, 1), Cells(last_row, last_col))
ActiveWorkbook.PivotCaches.Create(SourceType:=xlDatabase, SourceData:= _
rng, Version:=xlPivotTableVersion12).CreatePivotTable _
TableDestination:="data!R3C1", TableName:="PivotTable1", DefaultVersion _
:=xlPivotTableVersion12
It is working fine from last two years but suddenly it is showing this error while running macro.
" Method 'CreatePivotTable' of object 'PivotCache' failed."
Please help me on this issue.