Pivot table data source after exporting tabs from XLSM to XLSX

Stevep4

New Member
Joined
Aug 28, 2015
Messages
34
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

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)

Forum statistics

Threads
1,214,516
Messages
6,119,980
Members
448,934
Latest member
audette89

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