venkat3056
New Member
- Joined
- Oct 22, 2013
- Messages
- 3
Hi All,
I have one table which has a Name list and another pivot table which has a column 'Attribute_Name'. I want to filter the 'Attribute_Alias' to show only the Names in the table.
Even after setting Autosort to Manual and making the Manual update as True, I am still getting the below error:
Run-time Error: 1004 Unable to set the pivot table property of the pivot item class.
Please help resolve this issue.
Find the code below
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Dim i As Integer
Dim j As Integer
Dim pvtTable As PivotTable
Dim pvtField As PivotField
Set pvtTable = Worksheets("Violation Summary pivot").PivotTables("PivotTable3")
Set pvtField = pvtTable.PivotFields("[TravelData].[Attribute_Alias].[Attribute_Alias]")
'Clearing all filter, Setting manual update to true and changing Autosort to Manual
pvtField.ClearAllFilters
pvtTable.ManualUpdate = True
'pvtField.AutoSort xlManual, pvtField.SourceName
pvtTable.PivotFields("[TravelData].[Attribute_Alias].[Attribute_Alias]").AutoSort xlManual, "[TravelData].[Attribute_Alias].[Attribute_Alias]"
'Just trying to set the Visible property of one value to see if it works
MsgBox (pvtField.PivotItems(1))
pvtField.PivotItems(1).Visible = True 'I AM GETTING ERROR HERE'
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Thanks in Advance,
I have one table which has a Name list and another pivot table which has a column 'Attribute_Name'. I want to filter the 'Attribute_Alias' to show only the Names in the table.
Even after setting Autosort to Manual and making the Manual update as True, I am still getting the below error:
Run-time Error: 1004 Unable to set the pivot table property of the pivot item class.
Please help resolve this issue.
Find the code below
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Dim i As Integer
Dim j As Integer
Dim pvtTable As PivotTable
Dim pvtField As PivotField
Set pvtTable = Worksheets("Violation Summary pivot").PivotTables("PivotTable3")
Set pvtField = pvtTable.PivotFields("[TravelData].[Attribute_Alias].[Attribute_Alias]")
'Clearing all filter, Setting manual update to true and changing Autosort to Manual
pvtField.ClearAllFilters
pvtTable.ManualUpdate = True
'pvtField.AutoSort xlManual, pvtField.SourceName
pvtTable.PivotFields("[TravelData].[Attribute_Alias].[Attribute_Alias]").AutoSort xlManual, "[TravelData].[Attribute_Alias].[Attribute_Alias]"
'Just trying to set the Visible property of one value to see if it works
MsgBox (pvtField.PivotItems(1))
pvtField.PivotItems(1).Visible = True 'I AM GETTING ERROR HERE'
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Thanks in Advance,