Workbook.DefaultStyle property

Gets or sets the default Style object of the workbook.

public Style DefaultStyle { get; set; }


The DefaultStyle property is useful to implement a Style for the whole Workbook.


The following code creates and instantiates a new Workbook and sets a default Style to it.

Workbook workbook = new Workbook();
Style defaultStyle = workbook.DefaultStyle;
defaultStyle.Font.Name = "Tahoma";
workbook.DefaultStyle = defaultStyle;

[Visual Basic]
Dim workbook as Workbook = new Workbook()
Dim defaultStyle as Style = workbook.DefaultStyle
defaultStyle.Font.Name = "Tahoma"
workbook.DefaultStyle = defaultStyle

See Also