TM1 API how to get value stored in TM1valobject
Posted: Mon May 21, 2012 3:19 pm
hi,
I am trying to get NAME attribute of the control dimension "}Groups" . In order to do that I first get that value stored in the object handler as below
' -- handler to ger dimesnion object
grpDimesnion = TM1ObjectListHandleByNameGet(pPoolHandle, vServerhandle, TM1ServerDimensions(), TM1ValString(pPoolHandle, "}Groups", 0))
'-- handler object to store element
Dimelement = TM1ObjectListHandleByNameGet(pPoolHandle, grpDimesnion, TM1DimensionElements(), TM1ValString(pPoolHandle, "ADMIN", 0))
'--handler object to store attribute value
vAttrval = TM1ObjectListHandleByNameGet(pPoolHandle, Dimelement, TM1ObjectAttributes(), TM1ValString(pPoolHandle, "NAME", 0))
If TM1ValTypeObject = TM1ValType(SessionHandle, vAttrval) Then
MsgBox CInt(TM1ValTypeObject)
End If
--now calling procedure to retrieve string value of attribute
Call TM1ValObjectGet(SessionHandle, vAttrval, pobject) --> this throw the error
But this throws below runtime error which hangs excel client including TM1 perspective.
"Runtime error -'2147417848'
Automation error
The object invoked has disconnected from its client"
Any idea what is wrong here?
I am trying to get NAME attribute of the control dimension "}Groups" . In order to do that I first get that value stored in the object handler as below
' -- handler to ger dimesnion object
grpDimesnion = TM1ObjectListHandleByNameGet(pPoolHandle, vServerhandle, TM1ServerDimensions(), TM1ValString(pPoolHandle, "}Groups", 0))
'-- handler object to store element
Dimelement = TM1ObjectListHandleByNameGet(pPoolHandle, grpDimesnion, TM1DimensionElements(), TM1ValString(pPoolHandle, "ADMIN", 0))
'--handler object to store attribute value
vAttrval = TM1ObjectListHandleByNameGet(pPoolHandle, Dimelement, TM1ObjectAttributes(), TM1ValString(pPoolHandle, "NAME", 0))
If TM1ValTypeObject = TM1ValType(SessionHandle, vAttrval) Then
MsgBox CInt(TM1ValTypeObject)
End If
--now calling procedure to retrieve string value of attribute
Call TM1ValObjectGet(SessionHandle, vAttrval, pobject) --> this throw the error
But this throws below runtime error which hangs excel client including TM1 perspective.
"Runtime error -'2147417848'
Automation error
The object invoked has disconnected from its client"
Any idea what is wrong here?