This documentation is archived and is not being maintained.

Name Property [Excel 2003 VBA Language Reference]

Office 2003

Returns or sets the name of the object. Read/write String.

expression.Name

expression Required. An expression that returns one of the above objects.

Remarks

This property is read-only for chart objects (embedded charts).

Returns or sets the name of the object. The name of a Range object is a Name object. For every other type of object, the name is a String. Read/write Variant.

expression.Name

expression Required. An expression that returns one of the above objects.

Returns or sets the name of the list column. This is also used as the display name of the list column. This name must be unique within the list. Read/write String.

expression.Name

expression Required. An expression that returns a ListColumn object.

Note  If this list is linked to a SharePoint list, this property is read-only.

Returns or sets the name of the ListObject object. This name is used solely as a unique identifier for the Item property of the ListObjectscollection objects. This property can only be set through the object model. Read/write String.

expression.Name

expression Required. An expression that returns an ListObject object.

Remarks

By default, each ListObject object name begins with the word "List", followed by a number (no spaces). If an attempt is made to set the Name property to a name already used by another ListObject object, a run-time error is thrown.

Returns or sets the friendly name used to uniquely identify a mapping in the workbook. Read/write String.

expression.Name

expression Required. An expression that returns an XmlMap object.

Remarks

The string specified for the Name property must be unique within the workbook, and cannot exceed 255 characters.

Returns the friendly name used to identify an XML schema in an XmlMap object. Read-only String.

expression.Name

expression Required. An expression that returns an XmlSchema object.

Remarks

The following table shows example values of the Name property and related properties given an OLAP data source with the unique name "[Europe].[France].[Paris]" and a non-OLAP data source with the item name "Paris".

Property Value (OLAP data source) Value (non-OLAP data source)
Caption Paris Paris
Name [Europe].[France].[Paris] (read-only) Paris
SourceName [Europe].[France].[Paris] (read-only) (Same as SQL property value, read-only)
Value [Europe].[France].[Paris] (read-only) Paris

When specifying an index into the PivotItems collection, you can use the syntax shown in the following table.

Syntax (OLAP data source) Syntax (non-OLAP data source)
expression.PivotItems("[Europe].[France].[Paris]") expression.PivotItems("Paris")

When using the Item property to reference a specific member of a collection, you can use the text index name as shown in the following table.

Name (OLAP data source) Name (non-OLAP data source)
[Europe].[France].[Paris] Paris

Example

This example displays the name of style one in the active workbook, first in the language of the macro and then in the language of the user.

With ActiveWorkbook.Styles(1)
    MsgBox "The name of the style: " & .Name
    MsgBox "The localized name of the style: " & .NameLocal
End With
		

The following example displays the name of the default ListObject object in sheet1 of the active workbook.

       
Sub Test  
 Dim wrksht As Worksheet
   Dim oListObj As ListObject
   
   Set wrksht = ActiveWorkbook.Worksheets("Sheet1")
   Set oListObj = wrksht.ListObjects(1)
   
   MsgBox oListObj.Name  
End Sub 

  


See Also | NameLocal Property


Show: