View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Wigi Wigi is offline
external usenet poster
 
Posts: 396
Default Automatic refresh of pivot tables

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