Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Error:Unable to set the visible property of the PivotItem class.

I got the error
Unable to set the visible property of the PivotItem class.

when i try to set a pivotitem to visible:
Dim PF As PivotField
Dim PFI As PivotItem
For Each PF In PFs
Set PFs = ActiveSheet.PivotTables("PivotTable2").PivotFields
For Each PFI In PF.HiddenItems
PFI.Visible = True
Next PFI
Next PF

is there any solution, I have found yet no such (only at
http://www.experts-exchange.com/msof..._20275761.html
, but they wanted me to register first...)

Thanks
Holger
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Error:Unable to set the visible property of the PivotItem class.

See Debra Dalgleish's site

http://www.contextures.com/xlPivot03.html

Note that in her sample code she sets the autosort to manula before
unhidding the item, so this must be some bug she is allowing for:

Sub PivotShowItemAllVisible()
'sort is set to Manual to prevent errors, e.g.
'unable to set Visible Property of PivotItem class
Dim pt As PivotTable
Dim pf As PivotField
Dim pi As PivotItem
Application.ScreenUpdating = False
Application.DisplayAlerts = False
On Error Resume Next
For Each pt In ActiveSheet.PivotTables
For Each pf In pt.RowFields
pf.AutoSort xlManual, pf.SourceName
For Each pi In pf.PivotItems
pi.Visible = True
Next pi
pf.AutoSort xlAscending, pf.SourceName
Next pf
Next pt
Application.DisplayAlerts = True
Application.ScreenUpdating = True
End Sub
-- Regards,Tom Ogilvy
"Holger Pietsch" wrote in message
...
I got the error
Unable to set the visible property of the PivotItem class.

when i try to set a pivotitem to visible:
Dim PF As PivotField
Dim PFI As PivotItem
For Each PF In PFs
Set PFs = ActiveSheet.PivotTables("PivotTable2").PivotFields
For Each PFI In PF.HiddenItems
PFI.Visible = True
Next PFI
Next PF

is there any solution, I have found yet no such (only at
http://www.experts-exchange.com/msof..._20275761.html
, but they wanted me to register first...)

Thanks
Holger



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Error:Unable to set the visible property of the PivotItem clas

Hi Tom,

the example works fine. I am now trying to get my stuff running.

Thanks a lot.
Holger

"Tom Ogilvy" wrote:

See Debra Dalgleish's site

http://www.contextures.com/xlPivot03.html

Note that in her sample code she sets the autosort to manula before
unhidding the item, so this must be some bug she is allowing for:

Sub PivotShowItemAllVisible()
'sort is set to Manual to prevent errors, e.g.
'unable to set Visible Property of PivotItem class
Dim pt As PivotTable
Dim pf As PivotField
Dim pi As PivotItem
Application.ScreenUpdating = False
Application.DisplayAlerts = False
On Error Resume Next
For Each pt In ActiveSheet.PivotTables
For Each pf In pt.RowFields
pf.AutoSort xlManual, pf.SourceName
For Each pi In pf.PivotItems
pi.Visible = True
Next pi
pf.AutoSort xlAscending, pf.SourceName
Next pf
Next pt
Application.DisplayAlerts = True
Application.ScreenUpdating = True
End Sub
-- Regards,Tom Ogilvy
"Holger Pietsch" wrote in message
...
I got the error
Unable to set the visible property of the PivotItem class.

when i try to set a pivotitem to visible:
Dim PF As PivotField
Dim PFI As PivotItem
For Each PF In PFs
Set PFs = ActiveSheet.PivotTables("PivotTable2").PivotFields
For Each PFI In PF.HiddenItems
PFI.Visible = True
Next PFI
Next PF

is there any solution, I have found yet no such (only at
http://www.experts-exchange.com/msof..._20275761.html
, but they wanted me to register first...)

Thanks
Holger




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
VBA error: Unable to set the Values property of the Series class Marco Shaw Excel Programming 2 July 13th 05 03:40 PM
Unable to set the NumberFormat Property of the Range Class - ERROR Jon Delano Excel Programming 3 November 10th 04 07:33 PM
Error: Unable to get the OLEObjects property of the worksheet class Grant Excel Programming 2 August 6th 04 02:20 PM
Run-time error '1004' - Unable to set the Visible property of the Worksheet class Shalin Chopra Excel Programming 3 November 25th 03 08:38 PM
Unable to set the colorIndex Property of the Interior Class Error GriffyGriff Excel Programming 3 October 3rd 03 04:37 PM


All times are GMT +1. The time now is 08:31 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"