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)

XlCreator Creator { get; }

Property Value

Type: Microsoft.Office.Interop.Excel.XlCreator

The application in which the ListObject was created.

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

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.");
    }
}
Return to top
Show: