+ Reply to Thread
Results 1 to 4 of 4

VBA GetPivotData error

  1. #1
    Registered User
    Join Date
    08-04-2007
    Location
    London
    MS-Off Ver
    work: 2003, home: 2008 for Mac
    Posts
    32

    VBA GetPivotData error

    Hi All,

    I have something rather strange...

    my code is:

    Function returnExpenditure(projectDefinition, WbsElementEnd, recMonth)

    Call getSettingsData

    'concatanate the full WBS element from project definition and WBS End Fragment
    FullWbsElement = Trim(projectDefinition) & "-" & Trim(WbsElementEnd)

    ExpenditureInPeriod = Worksheets(sapPivotLocation).PivotTables(sapPivotName).GetPivotData("Value COCurr", "Per", recMonth, "WBS Element", FullWbsElement).Value

    returnExpenditure = ExpenditureInPeriod

    End Function
    this works fine for everything apart from for some reason where I put "SINT" as the string for WbsElementEnd I'm not getting any value out, however there is definately applicable data!

    any ideas??

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

    Re: VBA GetPivotData error

    You will have to debug this one as without table and code it's impossible to say.

    Start by checking the variables content. What do the following contain,
    sapPivotLocation
    sapPivotName
    recMonth
    FullWbsElement

    Are they valid?

    What happens if you use that information in the GETPCIVOTDATA function on a worksheet? Does it return the expected value.
    Cheers
    Andy
    www.andypope.info

  3. #3
    Registered User
    Join Date
    08-04-2007
    Location
    London
    MS-Off Ver
    work: 2003, home: 2008 for Mac
    Posts
    32

    Re: VBA GetPivotData error

    all the variables are valid, and yes the GETPIVOTDATA function returns the expected value, and I've tried every troubleshooting method I know on it, I'm coming to the conclusion that its probably going to be more effort to hunt down the issue than recreate it in another sheet, fortunately its not very far down the development line yet...

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

    Re: VBA GetPivotData error

    Can you post example ?

+ 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