Partager via


PublishObject.SourceType Property (Excel)

Returns a XlSourceType value that represents the type of item being published.

Syntax

expression .SourceType

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

See Also

Concepts

PublishObject Object

PublishObject Object Members