Hello,
I am trying to create a macro that saves a file using the name of a selected slicer item. My pivot table, though, is connected to an OLAP cube, and I am having troubles pulling the slicer item name.
Right now, I have this:
But I get a Run-time error '438': Object doesn't support this property or method.
I think it has something to do with being connected to an OLAP cube; there has to be a way to identify the selected slicer item... any thoughts?
I am trying to create a macro that saves a file using the name of a selected slicer item. My pivot table, though, is connected to an OLAP cube, and I am having troubles pulling the slicer item name.
Right now, I have this:
Code:
Public Sub SaveTables()
Dim GLSlicer As SlicerCache
Dim sFileName As String
Dim SFilePath As String
Set GLSlicer = ThisWorkbook.SlicerCaches("Slicer_Fiscal")
SFilePath = ThisWorkbook.Path & "\"
sFileName = GLSlicer.SlicerItem.Name & ".xlsm"
ThisWorkbook.SaveAs (SFilePath & sFileName)
End Sub
But I get a Run-time error '438': Object doesn't support this property or method.
I think it has something to do with being connected to an OLAP cube; there has to be a way to identify the selected slicer item... any thoughts?