Page 1 of 1

VBA to insert dimension attributes

Posted: Fri Aug 07, 2009 1:19 pm
by dk2316
Has anyone managed to manipulate dimension attributes via the API?

I've managed to create a dimension and add elements to the dimension using the example provided, but am having trouble with adding attributes to dimension (aliases) and then updating these attributes at the child node level.

I am guessing I need to use the TM1ObjectAttributeInsert() function to insert the attribute, and then use the TM1ObjectAttributeValueSet() function to give the attribute a value, but can't seem to find an example on the net.

I'm using tm1 v 9.4 and VBA with Excel 2003.

Any help would be much appreciated.

Dan

Re: VBA to insert dimension attributes

Posted: Fri Aug 07, 2009 1:41 pm
by highlnder8
I've just been through the wringer trying to EXTRACT a value from an attribute using the API. It's horrible and there are no example on the web that I could find either.

What worked for me, which someone here suggested, was to use the RUN(DBSA,server:dimension,value,attributename) macro VBA function.

I hope this helps!

Re: VBA to insert dimension attributes

Posted: Fri Aug 07, 2009 1:48 pm
by Martin Ryan
Just a minor fix on the above, it's actually run("dbsa", valueToSend, "server:dimension", element, attrName)

Martin