Share via


_Chart.ListBoxes Method

Returns or sets the text entries in the specified list box or a combo box, as an array of strings, or returns or sets a single text entry. An error occurs if there are no entries in the list.

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

Syntax

'Declaration
Function ListBoxes ( _
    Index As Object _
) As Object
'Usage
Dim instance As _Chart
Dim Index As Object
Dim returnValue As Object

returnValue = instance.ListBoxes(Index)
Object ListBoxes(
    Object Index
)

Parameters

  • Index
    Type: System.Object

    The index number of a single text entry to be set or returned. If this argument is omitted, the entire list is returned or set as an array of strings.

Return Value

Type: System.Object
Variant

Remarks

Setting this property clears any range specified by the ListFillRange property.

Examples

This example sets the entries in a list box on worksheet one. If Shapes(2) doesn’t represent a list box, this example fails.

Worksheets(1).Shapes(2).ControlFormat.List= _     Array("cogs", "widgets", "sprockets", "gizmos")

This example sets entry four in a list box on worksheet one. If Shapes(2) doesn’t represent a list box, this example fails.

Worksheets(1).Shapes(2).ControlFormat.List(4) = "gadgets"

See Also

Reference

_Chart Interface

_Chart Members

Microsoft.Office.Interop.Excel Namespace