Skip to content

Latest commit

 

History

History
51 lines (29 loc) · 1.1 KB

Excel.PivotTable.MDX.md

File metadata and controls

51 lines (29 loc) · 1.1 KB
title keywords f1_keywords api_name ms.assetid ms.date ms.localizationpriority
PivotTable.MDX property (Excel)
vbaxl10.chm235143
vbaxl10.chm235143
Excel.PivotTable.MDX
50a211c9-4b46-568c-5313-fd093d99a140
05/09/2019
medium

PivotTable.MDX property (Excel)

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

Syntax

expression.MDX

expression A variable that represents 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 that 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

[!includeSupport and feedback]