Find Pivot Table

Gives

Board Regular
Joined
Aug 22, 2006
Messages
160
I have the following macro to refresh all pivot tables in a workbook:

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


When I run the macro I get an error that

Run time error 1004
Cannot open PivotTable source file


The msgbox tells me that the offending table is PivotTable7 and tells me the source file that it is looking for which is a previous version of the current file. All of the data for the pivot tables in this workbook should be in this workbook so the error is probably a case where I had a current and old workbook open and accidently messed up the source assignment. Problem is - I can't find PivotTable7 in the current workbook. Any suggestions on how to find and delete it?
 

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!

Forum statistics

Threads
1,141,850
Messages
5,708,990
Members
421,602
Latest member
jkpce1880

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top