Add Method (Categories)
The Add method adds a Category object or SpecialCategory object to a Categories collection.
Syntax
Categories .Add([Type] [, Level ])
Applies To
Discussion
When you add an object to the Categories collection of a CategorySet object, the Type parameter must name a Category object or SpecialCategory object that already exists. For all other Categories collections, Type supplies a value of xtrObjectType or a variant that supplies an xtrObjectType value.
Use the optional Level parameter to specify which level the category belongs in.
A COM exception is thrown in error situations. The message that is passed with the exception varies depending on the error situation.
Parameter |
Description |
---|---|
Type |
Optional. For most collections, specifies either the trCategory or trSpecialCategory constant of xtrObjectType. In the case of the Categories collection of a CategorySet, it names an existing object. Type: Variant |
Level |
Optional. Specifies the name of the level where the category is to be added. If omitted, the category is added to the lowest level. Type: Object |
Return Type
Object
Examples
objSpecCategory =
_ objModel.Dimensions("Time").Categories.Add(xtrObjectType.trSpecialCategory)