Re: How to Refresh with VBA(SQL) created Pivot

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Richard (richardmacmillan_at_hfx.eastlink.ca)
Date: 03/04/04


Date: 4 Mar 2004 09:38:27 -0800

Paul LaPlant <pepeexcel@hotmail.com> wrote in message news:<uTb5Tp07DHA.3880@tk2msftngp13.phx.gbl>...
> Charles, I looked at that and I don't think that will solve my problem.
> I understand that will recreate the sheet and the pivottable, but I
> don't want to recreate it each time, I just want to be able to refresh
> it so that other pivottables that use the same source can be refreshed
> as well. I don't think this method will address that at all.
>
> Thanks
>
>
> *** Sent via Developersdex http://www.developersdex.com ***
> Don't just participate in USENET...get rewarded for it!

After creating a pivottable using your code, to refresh, recreate your
connection and recordset, then use the following code (changing
"PivotCaches(1)") to refer to the pivotcache you created.

Set objPivotCache = ActiveWorkbook.PivotCaches(1)
Set objPivotCache.Recordset = rsInfo
objPivotCache.Refresh



Relevant Pages

  • Re: How to Refresh with VBA(SQL) created Pivot
    ... I understand that will recreate the sheet and the pivottable, ... don't want to recreate it each time, I just want to be able to refresh ... it so that other pivottables that use the same source can be refreshed ...
    (microsoft.public.excel.programming)
  • Pivottable refresh problem
    ... I have code that is not refreshing a series of pivottables correctly. ... I've also tried to explicitly refresh each pivottable by code ... To Refresh QueryTables and Pivot Tables in this worksheet. ... 'Loop through each QueryTable in each specified worksheet ...
    (microsoft.public.excel.programming)
  • Re: Indexing problem with Make Table query and Create Index code (repost)
    ... Allen Browne - Microsoft MVP. ... It makes no difference how I relink - whether I delete and recreate - or ... And this happens even if I don't then refresh the links to ... table), and recreate it? ...
    (comp.databases.ms-access)
  • RE: How to refresh drop-down list of pivot table
    ... "Michael Pan" wrote: ... But the obsolete values are still there after refresh. ... you change and data in pivotable range all the related pivottables would have ... For Each ptTemp In Me.PivotTables ...
    (microsoft.public.excel.misc)
  • Re: Indexing problem with Make Table query and Create Index code (repost)
    ... It makes no difference how I relink - whether I delete and recreate - or just refresh. ... There appears to be something strange in the table creation process that causes the problem. ...
    (comp.databases.ms-access)