Found this online
breaks on this line -->
PT.PivotCache.BackgroundQuery = True
do i have to reference anything specific ?
breaks on this line -->
PT.PivotCache.BackgroundQuery = True
do i have to reference anything specific ?
Code:
Dim XL As Object
Dim wb As Object 'Workbooks
Dim ws As Object ' Worksheet
Dim PT As Object ' PivotTable
Set XL = CreateObject("Excel.Application")
Set wb = XL.Workbooks.Open(".........xltx")
'XL.Visible = True
For Each ws In wb.Worksheets
For Each PT In ws.PivotTables
PT.PivotCache.BackgroundQuery = True
PT.RefreshTable
Next PT
Next ws
wb.Close
XL.Quit
Set wb = Nothing
Set XL = Nothing