Results 1 to 4 of 4
  1. #1
    Join Date
    Jan 2004
    Location
    Lancashire, UK
    Posts
    6

    Post Unanswered: VB Data to Pivot table

    Morning.
    I sent data to Excel from a VB6 application through ADO.

    I recorded a macro to create a pivot table from this data, and copied the macro into the VB application, but am gettting the error:

    "Unable to get the pivotfields property of the pivottable class"

    Any ideas gratefully received.

  2. #2
    Join Date
    Nov 2003
    Posts
    7

    Re: VB Data to Pivot table

    RE: "Unable to get the pivotfields property of the pivottable class"

    Either the property really does not exist (double check the data that is being returned) or you are maybe having the bug in older versions of excel where the vb macro access to the pivot object would disconnect, therefore no objects are viewable from the code. This was patched up in later versions of office2000 and xp.

    If it is a data issue, you can debug your macro to determine the exact property it is looking for, then look to ensure your data has the required field(s) and values.

  3. #3
    Join Date
    Mar 2005
    Posts
    1
    What bug would this be. I am having a strange situation where I can get up to a point in customising a pivot table through VBA, and then when attempting to read the name property of a pivotitem I get the error:
    "Unable to get the pivotfields property of the pivottable class"

    Strangely even if I break before this line of code runs, and using the watch window look at the properties of the pivot item, the pivot table becomes unreadable, even though before I browsed the pivotitem properties in the watch window it was fine.

  4. #4
    Join Date
    Nov 2003
    Posts
    7
    [QUOTE=MPKusnierz]What bug would this be.

    This was a bug (from 2003) that was in Excel 2000, but we worked w/ MS and they create a hotfix and it was included in subsequent office updates.
    Any fully patched office 2000 or greater version will include a fix for this bug.

Posting Permissions

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