Class CustomProperty (Excel VBA)

The class CustomProperty represents identifier information, which can be used as metadata for XML.

Set

To use a CustomProperty class variable it first needs to be instantiated, for example

Dim cprp as CustomProperty
Set cprp = ActiveSheet.CustomProperties(Index:=1)

The following procedures can be used to set variables of type CustomProperty: Worksheet.CustomProperties, CustomProperties.Item and CustomProperties.Add

For Each

Here is an example of processing the CustomProperty items in a collection.

Dim cprpCustomPropertie As CustomProperty
For Each cprpCustomPropertie In ActiveSheet.CustomProperties
	
Next cprpCustomPropertie

CustomProperties.Add

Adds custom property information.

Add (Name, Value)

Dim strName As String: strName = 
Dim cprp As CustomProperty
Set cprp = ActiveSheet.CustomProperties.Add(Name:=strName, Value:=)

Arguments

The following arguments are required:

Name (String) - The name of the custom property.

Value (Variant) - The value of the custom property.

CustomProperties.Count

Returns a Long value that represents the number of objects in the collection.

Dim lngCount As Long
lngCount = ActiveSheet.CustomProperties.Count

CustomProperties.Item

Returns a single object from a collection.

Item (Index)

Index: The index number of the object.

Dim cprpItem As CustomProperty
Set cprpItem = ActiveSheet.CustomProperties(Index:=1)

CustomProperties.Parent

Returns the parent object for the specified object. Read-only.

Delete

Deletes the object.

You can delete custom document properties, but you cannot delete a built-in document property.

ActiveSheet.CustomProperties(1).Delete

Name

Returns or sets a String value representing the name of the object.

ActiveSheet.CustomProperties(1).Name =

Parent

Returns the parent object for the specified object. Read-only.

Value

Synonym for the Borders.LineStyle property.

ActiveSheet.CustomProperties(1).Value =