Unable to set the visible property of the pivotitem class

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,
 

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"

Forum statistics

Threads
1,223,231
Messages
6,170,884
Members
452,364
Latest member
springate

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top