Hi,
I have a Pivot Table called "Fakturagrunnlag" in an sheet called "Fakturagrunnlag".
In this table I have a filter (customer number) at cell B2 (field name = "KUNDENR").
I have created a form where I enter this filter (5 digit number) who then should filter this pivot. I have tried this code:
But that returns an run time error 1004 with a message saying it can't find the element in the OLAP cube.
Any suggestions?
I have a Pivot Table called "Fakturagrunnlag" in an sheet called "Fakturagrunnlag".
In this table I have a filter (customer number) at cell B2 (field name = "KUNDENR").
I have created a form where I enter this filter (5 digit number) who then should filter this pivot. I have tried this code:
Code:
Private Sub VisFakturagrunnlag_Click()
Dim Knr As Variant
Knr = Fakturagrunnlag_Form.Kundenr.Value
Sheets("Fakturagrunnlag").Select
ActiveSheet.PivotTables("Fakturagrunnlag").PivotFields( _
"[Tabell_sql_name_DB_Debitor].[KUNDENR].[KUNDENR]").ClearAllFilters
ActiveSheet.PivotTables("Fakturagrunnlag").PivotFields( _
"[Tabell_sql_name_DB_Debitor].[KUNDENR].[KUNDENR]"). _
CurrentPageName = "[Tabell_sql_name_DB_Debitor].[KUNDENR].&[Knr]"
Me.Hide
End Sub
But that returns an run time error 1004 with a message saying it can't find the element in the OLAP cube.
Any suggestions?