2 Replies Latest reply on May 9, 2017 7:24 PM by Aggie2000

    HypSetActiveMember returning -15

    Aggie2000

      Hi!  I'm attempting to use VBA to change a POV Member, and no matter what I try, HypSetActiveMember returns -15.  I ended up creating a very simple piece of code that retrieves the active member and then immediately tries to set it, assuming that if it just retrieved it successfully then it would be able to set it.  Nope, I get the -15 error.  I tried hard coding the value that was returned with HypGetActiveMember, same result.  I tried a different value that I was able to successfully retrieve using HypGetMembers, same result.  I tried setting the variable as a string, as Long, same result.  No matter what I do, it comes back as -15 error, which is according to the documentation is "Function contains an invalid parameter".  There are only two parameters for HypSetActiveMember, and I'm using the same ones that are successful with HypGetActiveMember, so what I am doing wrong?  Any help would be greatly appreciated.

       

      Sub Test()
          Dim vtMember As Variant
         
          sts = HypGetActiveMember("Cost Center", vtMember)
          If sts <> 0 Then MsgBox (sts)
          sts = HypSetActiveMember("Cost Center", vtMember)
          If sts <> 0 Then MsgBox (sts)

      End Sub

       

      Thanks!