Share via


ListObject.TableStyle Property (2007 System)

Gets or sets the table style.

Namespace:  Microsoft.Office.Tools.Excel
Assembly:  Microsoft.Office.Tools.Excel.v9.0 (in Microsoft.Office.Tools.Excel.v9.0.dll)

Syntax

'Declaration
Public Property TableStyle As Object
'Usage
Dim instance As ListObject 
Dim value As Object 

value = instance.TableStyle

instance.TableStyle = value
public Object TableStyle { get; set; }
public:
property Object^ TableStyle {
    Object^ get ();
    void set (Object^ value);
}
public function get TableStyle () : Object 
public function set TableStyle (value : Object)

Property Value

Type: System.Object
An object that represents the table style.

Examples

The following code example adds a ListObject to the Sheet1 sheet. The example then sets the table style of the ListObject, which corresponds to an Excel table, to the Table Style Dark 10 style. The table styles you can set for this property correspond to the table styles that are available in the Excel user interface on the Design tab that appears when a table is selected.

This example is for a document-level customization.

Private Sub SetListObjectStyle()        
    Dim myTable As Microsoft.Office.Tools.Excel.ListObject = _
    Globals.Sheet1.Controls.AddListObject( _
        Globals.Sheet1.Range("A1", "B3"), "myTable")

    myTable.TableStyle = "TableStyleDark10" 
End Sub
private void SetListObjectStyle()
{            
    Microsoft.Office.Tools.Excel.ListObject myTable = 
        Globals.Sheet1.Controls.AddListObject( 
            Globals.Sheet1.Range["A1", "B3"], "myTable");

    myTable.TableStyle = "TableStyleDark10";
}

.NET Framework Security

See Also

Reference

ListObject Class

ListObject Members

Microsoft.Office.Tools.Excel Namespace