+ Reply to Thread
Results 1 to 2 of 2

Cache of Pivot table is not selecting the table values

  1. #1
    Registered User
    Join Date
    04-29-2013
    Location
    Bangalore
    MS-Off Ver
    Excel 2007
    Posts
    17

    Cache of Pivot table is not selecting the table values

    Hi,

    I'm trying to create a pivot table , in that Set cacheOfpt = ActiveWorkbook.PivotCaches.Create(xlDatabase, Range("A1:Z" & lRow)) is not set properly , its showing null and also not showing any error at that line.

    I've attached my excel with pivot vba code in it.




    Thanks in Advance,
    Menaka
    Attached Files Attached Files

  2. #2
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,436

    Re: Cache of Pivot table is not selecting the table values

    Try taking the error trapping off whilst you debug you code. This will aleast help get the sheet references correct.

    The pass the name of the data base rather than a object reference
    [code]
    Set cacheOfpt = ActiveWorkbook.PivotCaches.Create(xlDatabase, "Data!" & Sheets("Data").Range("A1:Z" & lRow).Address)
    [\code]
    Cheers
    Andy
    www.andypope.info

+ 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