Share via


NamedRange.Creator Property (2007 System)

Gets a 32-bit integer that indicates the application in which the NamedRange control was created.

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

Syntax

'Declaration
<BrowsableAttribute(False)> _
Public ReadOnly Property Creator As XlCreator
'Usage
Dim instance As NamedRange 
Dim value As XlCreator 

value = instance.Creator
[BrowsableAttribute(false)]
public XlCreator Creator { get; }
[BrowsableAttribute(false)]
public:
property XlCreator Creator {
    XlCreator get ();
}
public function get Creator () : XlCreator

Property Value

Type: XlCreator
One of the XlCreator values.

Remarks

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

Examples

The following code example creates a NamedRange and then uses the Creator property to determine whether the NamedRange was created in Microsoft Office Excel.

This example is for a document-level customization.

Private displayCreatorRange As Microsoft.Office.Tools.Excel.NamedRange

Private Sub DisplayCreator()
    displayCreatorRange = Me.Controls.AddNamedRange( _
        Me.Range("C3", "E5"), "displayCreatorRange")
    displayCreatorRange.Select()
    If Me.displayCreatorRange.Creator = _
        Excel.XlCreator.xlCreatorCode Then
        MessageBox.Show("This NamedRange control was " & _
            "created in Microsoft Office Excel.")
    Else
        MessageBox.Show("This NamedRange control was " & _
            "not created in Microsoft Office Excel.")
    End If 
End Sub
Microsoft.Office.Tools.Excel.NamedRange displayCreatorRange;
private void DisplayCreator()
{
    displayCreatorRange = this.Controls.AddNamedRange(
        this.Range["C3", "E5"], "displayCreatorRange");
    displayCreatorRange.Select();
    if (this.displayCreatorRange.Creator == 
        Excel.XlCreator.xlCreatorCode)
    {
        MessageBox.Show("This NamedRange control was created in " +
            "Microsoft Office Excel.");
    }
    else
    {
        MessageBox.Show("This NamedRange control was not created in " +
            "Microsoft Office Excel.");
    }
}

.NET Framework Security

See Also

Reference

NamedRange Class

NamedRange Members

Microsoft.Office.Tools.Excel Namespace