+ Reply to Thread
Results 1 to 2 of 2

Adding code for pivot cache refresh within an existing function

  1. #1
    Registered User
    Join Date
    06-21-2011
    Location
    Portland, OR
    MS-Off Ver
    2010
    Posts
    14

    Post Adding code for pivot cache refresh within an existing function

    A little background: I have a function which requires some enhancements. This function as it currently exists is called to update pivot filters throughout my workbook based on a drop down list in which users select different lines of business. The code for this function is as follows:

    Please Login or Register  to view this content.
    The problem: I would like to include additional functionality that refreshes the pivot cache for one specific pivot table within this workbook. However, the new code below doesn't want to run. I get an error stating that the pivot table "NonBillableHours' is not defined... I feel like I am missing something basic here but can't put my finger on it. Thoughts? Suggestions?

    Please Login or Register  to view this content.

  2. #2
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Adding code for pivot cache refresh within an existing function

    If NonBillableHours is the pivot table name, put it in quotes or you can reference the pivot table by index number

    Set objPivotTable = ws.PivotTables("NonBillableHours")

    Or

    Set objPivotTable = ws.PivotTables(1)


    Edit:
    Also dim objPivotTable as one pivot table (remove the s)
    Dim objPivotTable As PivotTables
    Last edited by AlphaFrog; 05-22-2013 at 02:54 PM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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