Source Property

Microsoft Excel Visual Basic

Returns the unique name that identifies items that have a SourceType property value of xlSourceRange, xlSourceChart, xlSourcePrintArea, xlSourceAutoFilter, xlSourcePivotTable, or xlSourceQuery. If the SourceType property is set to xlSourceRange, this property returns a range, which can be a defined name. If the SourceType property is set to xlSourceChart, xlSourcePivotTable, or xlSourceQuery, this property returns the name of the object, such as a chart name, a PivotTable report name, or a query table name. Read-only String.

expression.Source

expression    Required. An expression that returns a PublishObject object.

ShowSource property as it applies to the Watch object.

Returns the unique name that identifies items that have a SourceType property value of xlSourceRange, xlSourceChart, xlSourcePrintArea, xlSourceAutoFilter, xlSourcePivotTable, or xlSourceQuery. If the SourceType property is set to xlSourceRange, this property returns a range, which can be a defined name. If the SourceType property is set to xlSourceChart, xlSourcePivotTable, or xlSourceQuery, this property returns the name of the object, such as a chart name, a PivotTable report name, or a query table name. Read-only Variant.

expression.Source

expression    Required. An expression that returns a Watch object.

Example

This example determines the unique name of the first chart (in the first workbook) saved as a Web page. and then it sets the Boolean variable blnChartFound to True. If no items in the document have been saved as Chart components, blnChartFound is False.

blnChartFound = False
For Each objPO In Workbooks(1).PublishObjects
    If objPO.SourceType = xlSourceChart Then
        strFirstPO = objPO.Source
        blnChartFound = True
        Exit For
    End If
Next objPO