>I understand Refresh. I am not sure if I explained the problem correctly: I don't need update pivot data, I need update PivotCache DataSource property - replace the select command with another one, for example:
>Old value:
>SELECT * from TABLE1
>New value:
>SELECT * from TABLE2
>
>And I need keep all PivotTables layouts and formatting.
>
>BTW: SourceData property is read/write
>
>Thanks
> Norbert
You don't need to update data ??? Aren't you doing that when you update Datasource ?
With .ActiveWorkbook.PivotCaches(1)
.CommandText = 'select * from Table2'
.BackGroundQuery = .F.
.Refresh
EndWith
PS: Yes sourcedata was readwrite, missed in help.
Cetin