This documentation is archived and is not being maintained.

MDX Property [Excel 2003 VBA Language Reference]

Office 2003

Returns a String indicating the MDX (Multidimensional Expression) that would be sent to the provider to populate the current PivotTable view. Read-only.

expression.MDX

expression Required. An expression that returns a PivotTable object.

Remarks

Querying this value for a non-Online Analytical Processing (OLAP) PivotTable, or when there is no PivotTable view (no data items), will return a run-time error.

Example

This example returns the MDX string for the PivotTable. It assumes a PivotTable exists on the active worksheet.

Sub CheckMDX()

    Dim pvtTable As PivotTable

    Set pvtTable = ActiveSheet.PivotTables(1)

    MsgBox "The MDX string for the PivotTable is: " & _
        pvtTable.MDX

End Sub
		


Applies to | PivotTable Object


Show: