Compartilhar via


ListObject.Creator Property

Definition

Gets the application in which the ListObject was created.

public:
 property Microsoft::Office::Interop::Excel::XlCreator Creator { Microsoft::Office::Interop::Excel::XlCreator get(); };
public Microsoft.Office.Interop.Excel.XlCreator Creator { get; }
member this.Creator : Microsoft.Office.Interop.Excel.XlCreator
Public ReadOnly Property Creator As XlCreator

Property Value

The application in which the ListObject was created.

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 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.");
    }
}
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

Remarks

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

Applies to