Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Table of Contents
maxLevel2
exclude\bExample\b
1

All three style types derive from the Style class, and NamedStyle derives from GlobalStyle.

...

To set a style, use the Style property or the SetStyle method. To apply a style, call ApplyStyle. Both are accessible through the following objects: Cell, Area, Range, RowProperties, and ColumnProperties. Anchor

GlobalStyle

...

GlobalStyle

A GlobalStyle is global to a workbook. It can be set or applied to cells, rows, columns, areas, and ranges. When a GlobalStyle is set (using the Style property), subsequent changes to the style affect all cells on which the style was set. When a GlobalStyle is applied (using the ApplyStyle method), subsequent changes to the style will not affect cells to which the style was applied.

...

To create a GlobalStyle, call Workbook.CreateStyle.

anchor 

NamedStyle

...

NamedStyle

The ExcelApplication object contains a collection of NamedStyles, which - unlike GlobalStyles are accessible after the workbook is saved. This collection includes Excel's built-in styles and any user-defined styles in a workbook opened with the ExcelApplication.Open method.

...

To return an existing NamedStyle, call Workbook.GetNamedStyle.

anchor 

CellStyle

...

CellStyle

Every cell in an Excel workbook contains a unique cell style. This style is exposed by ExcelWriter through the CellStyle class. Changes to a CellStyle affect only the cell that owns the style. A CellStyle may be set on another cell or group of cells, but this action clones the style. Changes to the original CellStyle reference affect only the owning cell and changes to the cloned CellStyle affect only the cell on which the style was set. If the style is set on a cell grouping object - such as an area, range, row, or column - each cell in the grouping receives a unique clone of the style.

...