Share via


Workbook.DefaultTableStyle Property (2007 System)

Gets or sets the table style from the TableStyles property that is used as the default style for tables in the workbook.

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

Syntax

'Declaration
<BrowsableAttribute(False)> _
Public Property DefaultTableStyle As Object
'Usage
Dim instance As Workbook 
Dim value As Object 

value = instance.DefaultTableStyle

instance.DefaultTableStyle = value
[BrowsableAttribute(false)]
public Object DefaultTableStyle { get; set; }
[BrowsableAttribute(false)]
public:
property Object^ DefaultTableStyle {
    Object^ get ();
    void set (Object^ value);
}
public function get DefaultTableStyle () : Object 
public function set DefaultTableStyle (value : Object)

Property Value

Type: System.Object
The table style from the TableStyles property that is used as the default style for tables in the workbook.

Examples

The following code example sets the default style of tables to Table Style Dark 11, which is a style that is available in Excel on the Design tab in the Table Styles group when a table is selected. The example then adds a table to verify the new table style.

This example is for a document-level customization.

Private Sub SetTableStyle()
    Me.DefaultTableStyle = Me.TableStyles("TableStyleDark11")

    ' Add a table to verify the new default table style 
    Dim myTable As Microsoft.Office.Tools.Excel.ListObject = _
    Globals.Sheet1.Controls.AddListObject( _
        Globals.Sheet1.Range("A1", "B3"), "myTable")
End Sub
private void SetTableStyle()
{
    this.DefaultTableStyle = this.TableStyles["TableStyleDark11"];

    // Add a table to verify the new default table style
    Microsoft.Office.Tools.Excel.ListObject myTable =
    Globals.Sheet1.Controls.AddListObject(
        Globals.Sheet1.Range["A1", "B3"], "myTable");
}

.NET Framework Security

See Also

Reference

Workbook Class

Workbook Members

Microsoft.Office.Tools.Excel Namespace