ListObject Object

Microsoft Office Web Components Visual Basic

ListObject Object

Multiple objects ListObject
Multiple objects

Using the ListObject Object

A ListObject object represents an XML list on a worksheet. The ListObject object is a member of the ListObjects collection. Individual ListObject objects in the ListObjects collection are indexed beginning with 1 for the first object, 2 for the second object, and so on. You use the Item property to return a single ListObject object from the ListObjects collection. The argument for the Item property is the name or the index number in the ListObjects collection of the ListObject object. The name is the value of the ID attribute of an Entry element (MapInfo/Map/Entry) in an XML spreadsheet file. The XML fragment where these details appear in the XML Spreadsheet file looks something like the following:

      <x2:MapInfo xmlns:x2="http://schemas.microsoft.com/office/excel/2003/xml"> 
   <x2:Map x2:ID="Cust_MapId">
      <x2:Entry x2:ID="example_id" x2:Type="table">
         ...
      </x2:Entry>
   </x2:Map>
</x2:MapInfo>
    

You can also get the name by using the Name property of the ListObject object. Using Microsoft Excel, you can create an XML Spreadsheet file by creating a data bound spreadsheet and then saving the workbook as an XML Spreadsheet.

This example sets the line weight of the border for the range of the specified list in the Spreadsheet component.

    Sub SetListBorder()
    Dim ssConstants
    Dim rngList

    Set ssConstants = Spreadsheet1.Constants
   
    ' Set a variable to the range that contains the list.
    Set rngList = Spreadsheet1.ActiveSheet.ListObjects(1).Range
   
    ' Set the range border weight.
    rngList.Borders.Weight = ssConstants.owcLineWeightMedium
End Sub