ListObject.Creator, propriété

Obtient l'application dans laquelle ListObject a été créé.

Espace de noms :  Microsoft.Office.Tools.Excel
Assembly :  Microsoft.Office.Tools.Excel (dans Microsoft.Office.Tools.Excel.dll)

Syntaxe

'Déclaration
ReadOnly Property Creator As XlCreator
XlCreator Creator { get; }

Valeur de propriété

Type : Microsoft.Office.Interop.Excel.XlCreator
Application dans laquelle ListObject a été créé.

Notes

Si l'objet a été créé dans Microsoft Office Excel, cette propriété retourne la chaîne XCEL qui équivaut au nombre hexadécimal 5843454C.

Exemples

L'exemple de code suivant crée un ListObject et vérifie si le code créateur correspond à Excel.Si c'est le cas, le code affiche un message.

Cet exemple illustre une personnalisation au niveau du document.

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

Sécurité .NET Framework

Voir aussi

Référence

ListObject Interface

Microsoft.Office.Tools.Excel, espace de noms