Omar Castillo
Omar Castillo

Reputation: 27

Smartview/Essbase VBA function not returning Member information

I am attempting to place the hyperion/Essbase parent name next to the child member using the GetHypParent() function but my code below places a 0 (meaning a succesful function?) in column K vs the parent name its self. How (or is there a way) that i can place the parent name next to the child name?

Sub Example_HypGetParent() Dim vtParent As Variant

For x = 9 To 20 ActiveSheet.Cells(x, 11) = HypGetParent(Empty, Trim(ActiveSheet.Cells(x, 4)), vtParent)

Next x

End Sub

Upvotes: 0

Views: 759

Answers (1)

jwj
jwj

Reputation: 521

The HypGetParent function returns an integer by design – it fills the vtParent variable with the value of the parent, assuming the call was successful. So theoretically you need something more like this:

For x = 9 To 20 
    Result = HypGetParent(Empty, Trim(ActiveSheet.Cells(x, 4)), vtParent)
    ActiveSheet.Cells(x, 11) = vtParent
Next x

Upvotes: 0

Related Questions