XlsStyle module

class XlsStyle.XlsStyle

Bases: AddtionalFormatWrapper, INamedObject

Represents a style in an Excel workbook.

This class extends AddtionalFormatWrapper and implements INamedObject to provide functionality for named cell styles in Excel. It allows access to style properties and supports operations like cloning and comparing styles.

BeginUpdate()

Begins a batch update operation on the style.

This method marks the start of a series of changes to the style properties. For better performance, multiple property changes should be made between BeginUpdate and EndUpdate calls.

property BuiltIn: bool

Gets whether the style is a built-in style.

Returns:

True if the style is a built-in style; otherwise, False.

Return type:

bool

Clone(parent: SpireObject) SpireObject

Creates a copy of the style.

Parameters:

parent (SpireObject) – The parent object for the cloned style.

Returns:

A new instance of the style.

Return type:

SpireObject

CompareTo(obj: SpireObject) int

Compares this style with another object.

Parameters:

obj (SpireObject) – The object to compare with this style.

Returns:

A value indicating the relative order of the objects being compared.

Less than zero: This instance precedes obj. Zero: This instance equals obj. Greater than zero: This instance follows obj.

Return type:

int

static DEF_DEFAULT_STYLES() List[str]

Gets a list of default style names.

Returns:

A list containing the names of default styles.

Return type:

List[str]

EndUpdate()

Ends a batch update operation on the style.

This method applies all pending changes to the style properties that were made since the last BeginUpdate call.

property Index: int

Gets the index of the style in the workbook’s style collection.

Returns:

The zero-based index of the style.

Return type:

int

property IsInitialized: bool

Gets whether the style has been initialized.

Returns:

True if the style has been initialized; otherwise, False.

Return type:

bool

property Name: str

Gets the name of the style.

Returns:

The name of the style.

Return type:

str