Losing Slicer Report Connections when copying sheets to new workbook

mssbass

Active Member
Joined
Nov 14, 2002
Messages
253
Platform
  1. Windows
I have slicers set up that connect to multiple pivot tables on my sheets. When I copy these sheets to a new workbook using VBA, these slicers no longer connect to the pivot tables. Anyone know how to fix?

Sub Main()

Dim wbO As Workbook, wbN As Workbook

Set wbO = ActiveWorkbook
Set wbN = Workbooks.Add

Application.DisplayAlerts = False

Sheet1.Copy wbN.Sheets(1)
Sheet2.Copy wbN.Sheets(2)
Sheet17.Copy wbN.Sheets(3)
Sheet3.Copy wbN.Sheets(4)
Sheet13.Copy wbN.Sheets(5)
Sheet4.Copy wbN.Sheets(6)
Sheet5.Copy wbN.Sheets(7)
Sheet6.Copy wbN.Sheets(8)
Sheet7.Copy wbN.Sheets(9)
Sheet11.Copy wbN.Sheets(10)
Sheet15.Copy wbN.Sheets(11)

wbN.Sheets("Sheet1").Delete
wbN.Sheets("Sup Detail Daily").Activate

wbN.SaveAs Filename:="\\SP16.ccc.abc.com@SSL\Dav\sites\Staff\Daily Points Production Report.xlsx", WriteResPassword:="bassinn1", ReadOnlyRecommended:=True
If wbO.CanCheckIn = True Then
wbO.CheckIn
Else
End If
wbN.Close


End Sub
 

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.

Forum statistics

Threads
1,214,926
Messages
6,122,305
Members
449,079
Latest member
juggernaut24

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