Basic Usage

Here is VBS code that prepares the Cellset object for use:

'Connect the same way you would connect the Catalog object.
Set cst1.ActiveConnection = cat1.ActiveConnection

'Specify the MD query with an MDX (Multidimensional Expressions) expression.
strSource = "SELECT " & _
            "{[Measures].members} ON COLUMNS, " & _
            "NON EMPTY [Store].[Store City].members ON ROWS " & _
            "FROM Sales"
cst1.Source = strSource

'Populate the Cellset object.
cst1.Open()

Object Members

Properties Collections Methods Events
  1. ActiveConnection
  2. FilterAxis
  3. Item
  4. Source
  5. State
  1. Axes
  2. Properties
  1. Close()
  2. Open()
  1. (None)

FilterAxis returns an Axis object for the dimensions used to filter (slice) the Cellset. The Axis returned by the FilterAxis property is not contained in the Axes collection.

Item returns a Cell object of the Cellset using coordinates. The Item property is the default property for the Cellset object, ie the following syntaxes are equivalent:

cst1.Item(Positions)
cst1(Positions)

Positions is a variant array that can be one of the following:

  • An array of zero-based position numbers, usu. (intPositionInAxis_0_x_column, intPositionInAxis_1_y_row).
    • EG: The Cell in the 4th column and 2nd row is (3,1) .
  • An array of member names by axis and then from outer most dimension inward. Each dimension is a separate string.
    • EG: ("Time.[1999].May.[15]", "Store.IL.Chicago.[Will E. Coyote Goods]", "Product.Acme.Rockets.[A1 Turbo]", "Measure.Revenue"). Note that I've never seen examples or usage of this so that's my guess of what it's supposed to look like.
  • The ordinal position relative to all cells.
    • EG1: If a cellset has 4 columns then the first row has ordinal positions 0-3, the second row has 4-7, etc.
    • EG2: A cellset with 4 columns and 3 rows will have 12 ordinal positions.
    • EG3: A cellset with 4 columns, 3 rows, and 2 z-dimensional rows will have 24 ordinal positions

State returns a read only long integer for the connection state of the Cellset: 0 (adStateClosed) or 1 (adStateOpen).



GeorgeHernandez.comSome rights reserved