Hi All,
If I clean and add new data in source area of the via VBA macro, I have problems if I run the refersh of the pivot table manually or using this VBA code
Set pt = Sheet4.PivotTables("PivotTable1")
pt.RefreshTable
If I use this VBA code
Dim lX As Long
For lX = 1 To Worksheets("Pivot").PivotTables.Count
Sheet4.PivotTables(lX).ChangePivotCache ActiveWorkbook. _
PivotCaches.Create(SourceType:=xlDatabase, SourceData:= _
"Dettaglio!" & Sheet1.Range("A1").CurrentRegion.Address(ReferenceStyle:=xlR1C1) _
, Version:=xlPivotTableVersion10)
Next
The error maessage is the following
Run-time error '438'
Object doesn't support this property or method.
Any suggestion will be well appreciated.
Thanks.
Regards,
Giovanni
If I clean and add new data in source area of the via VBA macro, I have problems if I run the refersh of the pivot table manually or using this VBA code
Set pt = Sheet4.PivotTables("PivotTable1")
pt.RefreshTable
If I use this VBA code
Dim lX As Long
For lX = 1 To Worksheets("Pivot").PivotTables.Count
Sheet4.PivotTables(lX).ChangePivotCache ActiveWorkbook. _
PivotCaches.Create(SourceType:=xlDatabase, SourceData:= _
"Dettaglio!" & Sheet1.Range("A1").CurrentRegion.Address(ReferenceStyle:=xlR1C1) _
, Version:=xlPivotTableVersion10)
Next
The error maessage is the following
Run-time error '438'
Object doesn't support this property or method.
Any suggestion will be well appreciated.
Thanks.
Regards,
Giovanni