SourceName Property

Applies To

OLEObject object, OLEObjects collection object, PivotField object, PivotItem object.

Description

OLEObject, OLEObjects objects: Return or set the specified object's link source name. Read/write String.

PivotField, PivotItem objects: Return the specified object's name, as it appears in the original source data for the PivotTable. This might be different from the current item name if the user renamed the item after creating the PivotTable. Read-only String.

Example

This example displays the original name (the name from the source database) of the item that contains the active cell.

Worksheets("Sheet1").Activate
ActiveSheet.PivotTables(1).PivotSelect "1998", xlDataAndLabel
MsgBox "The original item name is " & _
    ActiveCell.PivotItem.SourceName