ShowCellBackgroundFromOLAP Property

       

True if the MDX (Multidimensional Expression) that Microsoft Excel asks for includes the BackColor property for each cell in the data area that corresponds to a cell in the Online Analytical Processing (OLAP) data set. The default value is False. Read/write Boolean.

expression.ShowCellBackgroundFromOLAP

expression   Required. An expression that returns a PivotTable object.

Remarks

If the OLAP data set returns a BackColor property value, then the cell fill color is set to the nearest color in Microsoft Excel's palette for that worksheet. If the user applies cell pattern formatting to the cell manually, then that will override any formatting from the OLAP data set.

Example

This example determines the setting for showing the cell background from an OLAP data set and notifies the user. The example assumes a PivotTable exists on the active worksheet.

Sub CheckCellBackground()

    Dim pvtTable As PivotTable

    Set pvtTable = ActiveSheet.PivotTables(1)

    ' Determine setting and notify user.
    If pvtTable.ShowCellBackgroundFromOLAP = True Then
        MsgBox "The MDX will include the BackColor property for the cell."
    Else
        MsgBox "The MDX will not include the BackColor property for the cell."
    End If

End Sub