Pivot table data source after exporting tabs from XLSM to XLSX

Stevep4

New Member
Joined
Aug 28, 2015
Messages
35
I have a macro-enabled Excel file with many tabs on it. Four of the tabs contain Pivot tables that pull their data from one other tab. I have VB code that exports the five tabs to a specific location as an xlsx file. I make sure that the data tab is added first, then the four pivot tabs are added after. Below is the code:

Rich (BB code):
Rich (BB code):
Rich (BB code):
Rich (BB code):
Sub SaveCopyAs_Without_MacrosArrayFinal()
Sheets(Array("Data", "Pivot1", "Pivot2, "Pivot3", "Pivot4")).Copy
ActiveWorkbook.SaveAs Filename:="S:\Location\Archive\On Order " & Format(Date, "YYYY" & "MM" & "DD") & ".xlsx", FileFormat:=51
End Sub

The new file is created and saved where I want it. The problem is that the pivot tables are still pulling their data from the macro-enabled file and not from the data tab in the new xlsx file. Does anyone know how I can get the pivot tables to automatically pull the data from the file that is in the worksheet they're in?

Thanks
 

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.

Forum statistics

Threads
1,223,954
Messages
6,175,603
Members
452,658
Latest member
GStorm

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
Back
Top