Partager via


ListObject.Creator Property

Gets the application in which the ListObject was created.

Namespace:  Microsoft.Office.Tools.Excel
Assembly:  Microsoft.Office.Tools.Excel (in Microsoft.Office.Tools.Excel.dll)

Syntax

'Declaration
ReadOnly Property Creator As XlCreator
XlCreator Creator { get; }

Property Value

Type: Microsoft.Office.Interop.Excel.XlCreator
The application in which the ListObject was created.

Remarks

If the object was created in Microsoft Office Excel, this property returns the string XCEL, which is equivalent to the hexadecimal number 5843454C.

Examples

The following code example creates a ListObject and checks whether the creator code matches Excel. If the creator code matches, the code displays a message box.

This example is for a document-level customization.

Private Sub ListObject_Creator()
    Dim List1 As Microsoft.Office.Tools.Excel.ListObject = _
        Me.Controls.AddListObject(Me.Range("A1", "C4"), "List1")
    If List1.Creator = Excel.XlCreator.xlCreatorCode Then
        MessageBox.Show( _
            "This list object was created in Microsoft Office Excel.")
    End If 

End Sub
private void ListObject_Creator()
{
    Microsoft.Office.Tools.Excel.ListObject list1 = 
        this.Controls.AddListObject(
        this.Range["A1", "C4"], "list1");
    if (list1.Creator == Excel.XlCreator.xlCreatorCode)
    {
        MessageBox.Show("This list object was created in Microsoft Office Excel.");
    }
}

.NET Framework Security

See Also

Reference

ListObject Interface

Microsoft.Office.Tools.Excel Namespace