Hello!
I have a problem with an autorefresh of a pivot table. With this code, I refresh the origin of a pivot table to eliminate the "empty" field from filters. It works partially: the origin changes, filters are clean, pivot table is refreshed...but...when I go to work on filter, excel says that "The pivot table report was saved without the underlying data. use the update data command to update the report". If I click on "Update", the pivot doesn't update (it is already updated!!!) but filters starts to work.
Where's the error???
Thanks, sorry for bad english & I hope my translation is understandable
I have a problem with an autorefresh of a pivot table. With this code, I refresh the origin of a pivot table to eliminate the "empty" field from filters. It works partially: the origin changes, filters are clean, pivot table is refreshed...but...when I go to work on filter, excel says that "The pivot table report was saved without the underlying data. use the update data command to update the report". If I click on "Update", the pivot doesn't update (it is already updated!!!) but filters starts to work.
Where's the error???
Thanks, sorry for bad english & I hope my translation is understandable
Code:
Set NuovaCache = ActiveWorkbook.PivotCaches.Create(SourceType:=xlDatabase, _
SourceData:=percorso & "\Output\[Nuovo_QC_DT-V1.2 - Fatture Scadute.xlsx]Base Dati!R1C1:R" & lUltRiga & "C19")
With PT
.ChangePivotCache (NuovaCache)
.PivotCache.Refresh
.PivotFields("Dir. Territoriale").ClearAllFilters
.PivotFields("P.to oper.").ClearAllFilters
.PivotFields("Desc. P.to op.").ClearAllFilters
End With
Set NuovaCache = Nothing
'Aggiorno la base dati per la Pivot e pulisco tutti i filtri