NamedRange.ID Property (2007 System)

Gets or sets the identifying label for the NamedRange control when the page is saved as a Web page.

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 Property ID As String
'Usage
Dim instance As NamedRange 
Dim value As String 

value = instance.ID

instance.ID = value
[BrowsableAttribute(false)]
public string ID { get; set; }
[BrowsableAttribute(false)]
public:
property String^ ID {
    String^ get ();
    void set (String^ value);
}
public function get ID () : String 
public function set ID (value : String)

Property Value

Type: System.String
The identifying label for the NamedRange control when the page is saved as a Web page.

Remarks

Using this property on a NamedRange control that contains multiple cells will cause an exception to be thrown.

You can use an ID label as a hyperlink reference in other HTML documents or on the same Web page.

Examples

The following code example creates a NamedRange and then uses the ID property to set an ID that will be used if the workbook is saved as a Web page.

This example is for a document-level customization.

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

Private Sub SetID()
    idRange = Me.Controls.AddNamedRange(Me.Range("B4"), "idRange")
    Me.idRange.ID = "Lastname" 
End Sub
Microsoft.Office.Tools.Excel.NamedRange idRange;
private void SetID()
{
    idRange = this.Controls.AddNamedRange(
        this.Range["B4", missing], "idRange");
    this.idRange.ID = "Lastname";
}

.NET Framework Security

See Also

Reference

NamedRange Class

NamedRange Members

Microsoft.Office.Tools.Excel Namespace