Rename Method (INamedValue2 interface)



Changes the name of this NamedValue object.


object.Rename NewName


The Rename method syntax has these parts:

Part Description
object An object expression that evaluates to an INamedValue2 interface.
NewName A String which becomes the new value of the Name property.



If the object is an orphan (its Parent property is Nothing), the new name is simply written into the object's Name property.

If the object has a parent, then depending on the setting of the parent's Style property, any leading or trailing blanks may be stripped from NewName before renaming the object. Also, the rename will fail if there is already an object with the same name in the parent collection. The equality test takes the parent's pinvCaseSensitive and pinvLocaleSensitive style flags into account.


Trappable Errors

In addition to generic errors (such as Out of Memory), the following errors may occur:

Error Description
pseACCESSDENIED The object's parent collection cannot be modified because it is frozen; that is, the collection's ReadOnly property is true.
pseDUPLICATENAME The object's parent collection already contains an item with the given name.
Enabling Operational Intelligence