Hi,
I am trying to get a macro to run to automatically change the filters in a Pivot table linked to a Cube.
I recorded the macro to begin with but I always get the error listed in the title of this thread.
My code is:
The line it is pointing to is the final line in the code beginning with "[Business_Unit]..
Any ideas that could be the reason for the error?
I am trying to get a macro to run to automatically change the filters in a Pivot table linked to a Cube.
I recorded the macro to begin with but I always get the error listed in the title of this thread.
My code is:
Code:
Sub CubeReconcile()
Application.ScreenUpdating = False
Workbooks.Open ("P:\Desktop\Cube v1.xlsm")
ThisWorkbook.Activate
Application.ScreenUpdating = True
ActiveSheet.PivotTables("ECBv1.0").PivotFields( _
"[Business_Unit].[Business Unit Hierarchy].[Business_Unit]"). _
ClearAllFilters
ActiveSheet.PivotTables("Cubev1.0").PivotFields( _
"[Business_Unit].[Business Unit Hierarchy].[Business_Unit]"). _
CurrentPageName = _
"[Business_Unit].[Business Unit Hierarchy].[Business_Unit].&[European]"
End Sub
The line it is pointing to is the final line in the code beginning with "[Business_Unit]..
Any ideas that could be the reason for the error?