+ Reply to Thread
Results 1 to 1 of 1

VBA - PivotTable - Cannot Create Cache

  1. #1
    Registered User
    Join Date
    03-23-2011
    Location
    New York, NY
    MS-Off Ver
    Excel 2010
    Posts
    50

    VBA - PivotTable - Cannot Create Cache

    UPDATE - I changed PRange to PRange.Address in the Set PTCache line of code and it worked. Can anyone explain the technical reason behind this?

    Good afternoon everyone,

    I am having the damndest time trying to have a PivotTable created via VBA. Here is the setup:

    I have a sheet with one tab called Source
    This tab has source information consisting of columns A:AF and a varrying # of rows each day.

    My goal is to create two new worksheets and have a PivotTable appear on each. They both show pretty much the same data with the exception of one sheet having an additional data field. I am using Excel 2010.

    I've broken the code into three blocks (I will add blocks 2 and 3 if necessary but I feel like they aren't causing the problem):
    1) Establishes static variables such as sheet names and output variables
    2) Creates the first sheet and PivotTable on it
    3) Creates the second sheet and PivotTable on it

    My code continuously fails at the "Set PTCache = " line

    Please Login or Register  to view this content.
    I've scoured the net and tried different combinations of suggested changes but they all generate the same error - Run-Time Error 5, Invalid Procedure Call.

    Thanks guys.
    Last edited by ryanmorris; 06-07-2012 at 03:09 PM. Reason: UPDATE

+ 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