Hi All,

Wondering if someone can help...
I just started playing around with using VBA on manipulating PivotTables and Slicer.

Currently I have the following on my workbook...
  • 6 x Worksheets containing pivot tables only
  • 1 x Worksheet that contains a slicer ("Slicer_SERVICE_TYPE") that has a PivotTable Connection to the 6 other worksheets

Slicer is created and working fine but when I run my code I lose all the PivotTable Connections.

I got the Pivot Table updating successfully using VBA Code:
Dim RawDataSource as String
RawDataSource = "C:\New Reporting\[Raw-Data.xlsx]0110!R1C1:R98C29"
For X = 1 to 6
    Worksheets(X).Activate
    Worksheets(X).PivotTables(1).SourceData = RawDataSource
Next X
Is there a way I can fix this?
Am I missing one line of code?

I've searched everywhere and could not find any results specifically to my issue.

Thanks in Advance!