I have done quite a bit of searching for a solution to synchronizing two slicers linked to two different OLAP sources, but I've only found solutions to syncing one OLAP slicer to one non-OLAP slicer.
One solution to synchronize an OLAP based slicer and a non-OLAP based slicer was posted on the Experts-Exchange website, Titled - "Help-me-Sync-2-Slicers-with-Different-Data-Source"
The code from the above site is below:
Private Sub Worksheet_PivotTableUpdate(ByVal Target As PivotTable)
Dim scOLAP As SlicerCache
Dim scList As SlicerCache
Dim sO As Slicer
Dim sL As Slicer
Dim si As SlicerItem
Dim i As Integer
Dim svalue As String
Dim ar() As String
Set scOLAP = ActiveWorkbook.SlicerCaches("Slicer_RegionCode")
Set scList = ActiveWorkbook.SlicerCaches("Slicer_RegionCode1")
scList.ClearManualFilter
Set sO = scOLAP.Slicers(1)
Set sL = scList.Slicers(1)
ReDim ar(UBound(scOLAP.VisibleSlicerItemsList))
For i = 1 To UBound(scOLAP.VisibleSlicerItemsList)
svalue = Replace(Replace(scOLAP.VisibleSlicerItemsList(i), "[CleanedData].[RegionCode].&[", ""),"]", "")
ar(i) = svalue
Next
For Each si In scList.SlicerItems
If UBound(Filter(ar, si.SourceName)) < 0 Then
si.Selected = False
End If
Next
End Sub
My specific question is, if the variable "scList" were connected to an OLAP Slicer Cache instead of a non-Olap slicer cache, what modification would be needed to the code above? I know that the property "SlicerItems" returns an error for Olap slicers, so this code will error out at:
For Each si In scList.SlicerItems
Thank you in advance for your help.