ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Macro pt.RefreshTable (https://www.excelbanter.com/excel-programming/395571-macro-pt-refreshtable.html)

Paul Dennis

Macro pt.RefreshTable
 
I have a macro that load new data and I need to refresh several pivot tables.
I am using the

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

[PivotTables] is the name of the sheet

I get the error "Runtime Error 438 Object doesn't support this property or
method"

Any ideas?

KLZA

Macro pt.RefreshTable
 
Hi. I used the following code and it works fine as a macro.. On what
line do you get the error??

Sub Pivots()
For Each ws In ActiveWorkbook.Worksheets
For Each pt In ws.PivotTables
pt.RefreshTable
Next pt
Next ws
End Sub

On Aug 15, 1:06 pm, Paul Dennis
wrote:
I have a macro that load new data and I need to refresh several pivot tables.
I am using the

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

[PivotTables] is the name of the sheet

I get the error "Runtime Error 438 Object doesn't support this property or
method"

Any ideas?




Paul Dennis

Macro pt.RefreshTable
 
For Each pt In ws.PivotTables

"KLZA" wrote:

Hi. I used the following code and it works fine as a macro.. On what
line do you get the error??

Sub Pivots()
For Each ws In ActiveWorkbook.Worksheets
For Each pt In ws.PivotTables
pt.RefreshTable
Next pt
Next ws
End Sub

On Aug 15, 1:06 pm, Paul Dennis
wrote:
I have a macro that load new data and I need to refresh several pivot tables.
I am using the

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

[PivotTables] is the name of the sheet

I get the error "Runtime Error 438 Object doesn't support this property or
method"

Any ideas?






All times are GMT +1. The time now is 11:31 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com