PC Review


Reply
Thread Tools Rate Thread

Automatic refresh of pivot tables

 
 
=?Utf-8?B?RGFu?=
Guest
Posts: n/a
 
      19th Aug 2007
I am looking for an automatic procedure to open a file (excel 2003), refresh
all pivot tables (olap cubes) and save it.
thanks

 
Reply With Quote
 
 
 
 
=?Utf-8?B?V2lnaQ==?=
Guest
Posts: n/a
 
      19th Aug 2007
Hi

Sub OpenUpdatePivotTablesSave()

Dim pt As PivotTable
Dim ws As Worksheet
Dim wb As Workbook

Set wb = Workbooks.Open("C:\Myfile.xls")

For Each ws In wb.Worksheets

For Each pt In ws.PivotTables
pt.RefreshTable
Next pt

Next ws

wb.Save

End Sub


--
Wigi
http://www.wimgielis.be = Excel/VBA, soccer and music


"Dan" wrote:

> I am looking for an automatic procedure to open a file (excel 2003), refresh
> all pivot tables (olap cubes) and save it.
> thanks
>

 
Reply With Quote
 
=?Utf-8?B?RGFu?=
Guest
Posts: n/a
 
      19th Aug 2007
Thanks Wigi. it works


"Wigi" wrote:

> Hi
>
> Sub OpenUpdatePivotTablesSave()
>
> Dim pt As PivotTable
> Dim ws As Worksheet
> Dim wb As Workbook
>
> Set wb = Workbooks.Open("C:\Myfile.xls")
>
> For Each ws In wb.Worksheets
>
> For Each pt In ws.PivotTables
> pt.RefreshTable
> Next pt
>
> Next ws
>
> wb.Save
>
> End Sub
>
>
> --
> Wigi
> http://www.wimgielis.be = Excel/VBA, soccer and music
>
>
> "Dan" wrote:
>
> > I am looking for an automatic procedure to open a file (excel 2003), refresh
> > all pivot tables (olap cubes) and save it.
> > thanks
> >

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Code to Refresh inbound data sheets, then Refresh Pivot Tables AFSSkier Microsoft Excel Programming 3 4th Sep 2009 07:59 PM
Automatic Refresh for Pivot Table Carim Microsoft Excel Programming 3 29th Apr 2005 11:48 AM
Timing of automatic query refresh and macro pivot table refresh =?Utf-8?B?ZHV0dHk=?= Microsoft Excel Programming 2 1st Dec 2004 07:19 PM
Pivot chart, automatic refresh VILLABILLA Microsoft Excel Charting 3 28th May 2004 12:18 PM
Automatic refresh pivot table Harry Microsoft Access VBA Modules 0 10th Oct 2003 10:30 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:05 PM.