CustomProperties Object (Excel)

A collection of CustomProperty objects that represent additional information. The information can be used as metadata for XML.


Use CustomProperties property of the Worksheet object to return a CustomProperties collection.

Once a CustomProperties collection is returned, you can add metadata to worksheets and additional actions depending on which you choose to work with.

To add metadata to a worksheet, use the CustomProperties property with the Add method.


The following example demonstrates this feature. In this example, Microsoft Excel adds identifier information to the active worksheet and returns the name and value to the user.

Sub CheckCustomProperties() 
 Dim wksSheet1 As Worksheet 
 Set wksSheet1 = Application.ActiveSheet 
 ' Add metadata to worksheet. 
 wksSheet1.CustomProperties.Add _ 
 Name:="Market", Value:="Nasdaq" 
 ' Display metadata. 
 With wksSheet1.CustomProperties.Item(1) 
 MsgBox .Name & vbTab & .Value 
 End With 
End Sub

See Also


Excel Object Model Reference

CustomProperties Object Members