+ Reply to Thread
Results 1 to 2 of 2

set PivotItem.Visible property fails

  1. #1
    Registered User
    Join Date
    02-16-2005
    Posts
    5

    set PivotItem.Visible property fails

    Hi,
    Could anyone help me understand why the following sub fails:

    Sub vcTransactionPivotSetup()
    Dim rngToSet As Range, intRow As Integer, intColumn As Integer, intBlank As Integer
    Dim ws As Worksheet, pt As PivotTable, pi As PivotItem
    Dim pf As PivotField


    Set ws = ThisWorkbook.Worksheets("Client View")
    Set pt = ws.PivotTables("pvtTransactionData")
    Set pf = pt.ColumnFields("Status")

    'refresh table
    pt.RefreshTable
    'refresh pivot cache
    pt.PivotCache.Refresh

    For Each pi In pf.PivotItems
    If pi.Value = "" Then
    pi.Visible = False
    Else
    pi.Visible = True
    End If
    Next

    'clean-up
    Set ws = Nothing
    Set pt = Nothing
    Set pf = Nothing
    End Sub

    I am trying to hide the empty string entries and I'm getting a 1004 error "Unable to set the Visible property of the PivotItem class" in both Excel 2000 and Excel 2003. The sheet is unprotected, the pivot table doesn't store data.

    Thank you

  2. #2
    Registered User
    Join Date
    02-16-2005
    Posts
    5

    Solved -please Ignore

    Thanks to Debra (replying to Stanshoe on "PivotTable Problem" this is fixed now,
    it was the sort order...

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1