Compartilhar via


_Worksheet.CodeName Property

Returns the code name for the object. Read-only String.

Namespace:  Microsoft.Office.Interop.Excel
Assembly:  Microsoft.Office.Interop.Excel (in Microsoft.Office.Interop.Excel.dll)

Syntax

'Declaration
ReadOnly Property CodeName As String
    Get
'Usage
Dim instance As _Worksheet
Dim value As String

value = instance.CodeName
string CodeName { get; }

Property Value

Type: System.String

Remarks

The value that you see in the cell to the right of (Name) in the Properties window is the code name of the selected object. At design time, you can change the code name of an object by changing this value. You cannot programmatically change this property at run time.

The code name for an object can be used in place of an expression that returns the object.

It’s possible for the sheet name to be different from the code name. When you create a sheet, the sheet name and code name are the same, but changing the sheet name doesn’t change the code name, and changing the code name (using the Properties window in the Visual Basic Editor) doesn’t change the sheet name.

See Also

Reference

_Worksheet Interface

_Worksheet Members

Microsoft.Office.Interop.Excel Namespace