Macro pt.RefreshTable

P

Paul Dennis

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?
 
K

KLZA

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
 
P

Paul Dennis

For Each pt In ws.PivotTables

KLZA said:
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

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?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top