ExcelScript.PredefinedCellStyle interface

An object encapsulating a style's format and other properties.

Methods

delete()

Deletes this style.

getAutoIndent()

Specifies if text is automatically indented when the text alignment in a cell is set to equal distribution.

getBorders()

A collection of four border objects that represent the style of the four borders.

getBuiltIn()

Specifies if the style is a built-in style.

getFill()

The fill of the style.

getFont()

A Font object that represents the font of the style.

getFormulaHidden()

Specifies if the formula will be hidden when the worksheet is protected.

getHorizontalAlignment()

Represents the horizontal alignment for the style. See ExcelScript.HorizontalAlignment for details.

getIncludeAlignment()

Specifies if the style includes the auto indent, horizontal alignment, vertical alignment, wrap text, indent level, and text orientation properties.

getIncludeBorder()

Specifies if the style includes the color, color index, line style, and weight border properties.

getIncludeFont()

Specifies if the style includes the background, bold, color, color index, font style, italic, name, size, strikethrough, subscript, superscript, and underline font properties.

getIncludeNumber()

Specifies if the style includes the number format property.

getIncludePatterns()

Specifies if the style includes the color, color index, invert if negative, pattern, pattern color, and pattern color index interior properties.

getIncludeProtection()

Specifies if the style includes the formula hidden and locked protection properties.

getIndentLevel()

An integer from 0 to 250 that indicates the indent level for the style.

getLocked()

Specifies if the object is locked when the worksheet is protected.

getName()

The name of the style.

getNumberFormat()

The format code of the number format for the style.

getNumberFormatLocal()

The localized format code of the number format for the style.

getRangeBorder(index)

Gets a border object using its name.

getRangeBorderTintAndShade()

Specifies a double that lightens or darkens a color for range borders. The value is between -1 (darkest) and 1 (brightest), with 0 for the original color. A null value indicates that the entire border collection doesn't have a uniform tintAndShade setting.

getReadingOrder()

The reading order for the style.

getShrinkToFit()

Specifies if text automatically shrinks to fit in the available column width.

getTextOrientation()

The text orientation for the style.

getVerticalAlignment()

Specifies the vertical alignment for the style. See ExcelScript.VerticalAlignment for details.

getWrapText()

Specifies if Excel wraps the text in the object.

setAutoIndent(autoIndent)

Specifies if text is automatically indented when the text alignment in a cell is set to equal distribution.

setFormulaHidden(formulaHidden)

Specifies if the formula will be hidden when the worksheet is protected.

setHorizontalAlignment(horizontalAlignment)

Represents the horizontal alignment for the style. See ExcelScript.HorizontalAlignment for details.

setIncludeAlignment(includeAlignment)

Specifies if the style includes the auto indent, horizontal alignment, vertical alignment, wrap text, indent level, and text orientation properties.

setIncludeBorder(includeBorder)

Specifies if the style includes the color, color index, line style, and weight border properties.

setIncludeFont(includeFont)

Specifies if the style includes the background, bold, color, color index, font style, italic, name, size, strikethrough, subscript, superscript, and underline font properties.

setIncludeNumber(includeNumber)

Specifies if the style includes the number format property.

setIncludePatterns(includePatterns)

Specifies if the style includes the color, color index, invert if negative, pattern, pattern color, and pattern color index interior properties.

setIncludeProtection(includeProtection)

Specifies if the style includes the formula hidden and locked protection properties.

setIndentLevel(indentLevel)

An integer from 0 to 250 that indicates the indent level for the style.

setLocked(locked)

Specifies if the object is locked when the worksheet is protected.

setNumberFormat(numberFormat)

The format code of the number format for the style.

setNumberFormatLocal(numberFormatLocal)

The localized format code of the number format for the style.

setRangeBorderTintAndShade(rangeBorderTintAndShade)

Specifies a double that lightens or darkens a color for range borders. The value is between -1 (darkest) and 1 (brightest), with 0 for the original color. A null value indicates that the entire border collection doesn't have a uniform tintAndShade setting.

setReadingOrder(readingOrder)

The reading order for the style.

setShrinkToFit(shrinkToFit)

Specifies if text automatically shrinks to fit in the available column width.

setTextOrientation(textOrientation)

The text orientation for the style.

setVerticalAlignment(verticalAlignment)

Specifies the vertical alignment for the style. See ExcelScript.VerticalAlignment for details.

setWrapText(wrapText)

Specifies if Excel wraps the text in the object.

Method Details

delete()

Deletes this style.

delete(): void;

Returns

void

getAutoIndent()

Specifies if text is automatically indented when the text alignment in a cell is set to equal distribution.

getAutoIndent(): boolean;

Returns

boolean

getBorders()

A collection of four border objects that represent the style of the four borders.

getBorders(): RangeBorder[];

Returns

getBuiltIn()

Specifies if the style is a built-in style.

getBuiltIn(): boolean;

Returns

boolean

getFill()

The fill of the style.

getFill(): RangeFill;

Returns

getFont()

A Font object that represents the font of the style.

getFont(): RangeFont;

Returns

getFormulaHidden()

Specifies if the formula will be hidden when the worksheet is protected.

getFormulaHidden(): boolean;

Returns

boolean

getHorizontalAlignment()

Represents the horizontal alignment for the style. See ExcelScript.HorizontalAlignment for details.

getHorizontalAlignment(): HorizontalAlignment;

Returns

getIncludeAlignment()

Specifies if the style includes the auto indent, horizontal alignment, vertical alignment, wrap text, indent level, and text orientation properties.

getIncludeAlignment(): boolean;

Returns

boolean

getIncludeBorder()

Specifies if the style includes the color, color index, line style, and weight border properties.

getIncludeBorder(): boolean;

Returns

boolean

getIncludeFont()

Specifies if the style includes the background, bold, color, color index, font style, italic, name, size, strikethrough, subscript, superscript, and underline font properties.

getIncludeFont(): boolean;

Returns

boolean

getIncludeNumber()

Specifies if the style includes the number format property.

getIncludeNumber(): boolean;

Returns

boolean

getIncludePatterns()

Specifies if the style includes the color, color index, invert if negative, pattern, pattern color, and pattern color index interior properties.

getIncludePatterns(): boolean;

Returns

boolean

getIncludeProtection()

Specifies if the style includes the formula hidden and locked protection properties.

getIncludeProtection(): boolean;

Returns

boolean

getIndentLevel()

An integer from 0 to 250 that indicates the indent level for the style.

getIndentLevel(): number;

Returns

number

getLocked()

Specifies if the object is locked when the worksheet is protected.

getLocked(): boolean;

Returns

boolean

getName()

The name of the style.

getName(): string;

Returns

string

getNumberFormat()

The format code of the number format for the style.

getNumberFormat(): string;

Returns

string

getNumberFormatLocal()

The localized format code of the number format for the style.

getNumberFormatLocal(): string;

Returns

string

getRangeBorder(index)

Gets a border object using its name.

getRangeBorder(index: BorderIndex): RangeBorder;

Parameters

index
ExcelScript.BorderIndex

Index value of the border object to be retrieved. See ExcelScript.BorderIndex for details.

Returns

getRangeBorderTintAndShade()

Specifies a double that lightens or darkens a color for range borders. The value is between -1 (darkest) and 1 (brightest), with 0 for the original color. A null value indicates that the entire border collection doesn't have a uniform tintAndShade setting.

getRangeBorderTintAndShade(): number;

Returns

number

getReadingOrder()

The reading order for the style.

getReadingOrder(): ReadingOrder;

Returns

getShrinkToFit()

Specifies if text automatically shrinks to fit in the available column width.

getShrinkToFit(): boolean;

Returns

boolean

getTextOrientation()

The text orientation for the style.

getTextOrientation(): number;

Returns

number

getVerticalAlignment()

Specifies the vertical alignment for the style. See ExcelScript.VerticalAlignment for details.

getVerticalAlignment(): VerticalAlignment;

Returns

getWrapText()

Specifies if Excel wraps the text in the object.

getWrapText(): boolean;

Returns

boolean

setAutoIndent(autoIndent)

Specifies if text is automatically indented when the text alignment in a cell is set to equal distribution.

setAutoIndent(autoIndent: boolean): void;

Parameters

autoIndent

boolean

Returns

void

setFormulaHidden(formulaHidden)

Specifies if the formula will be hidden when the worksheet is protected.

setFormulaHidden(formulaHidden: boolean): void;

Parameters

formulaHidden

boolean

Returns

void

setHorizontalAlignment(horizontalAlignment)

Represents the horizontal alignment for the style. See ExcelScript.HorizontalAlignment for details.

setHorizontalAlignment(horizontalAlignment: HorizontalAlignment): void;

Parameters

horizontalAlignment
ExcelScript.HorizontalAlignment

Returns

void

setIncludeAlignment(includeAlignment)

Specifies if the style includes the auto indent, horizontal alignment, vertical alignment, wrap text, indent level, and text orientation properties.

setIncludeAlignment(includeAlignment: boolean): void;

Parameters

includeAlignment

boolean

Returns

void

setIncludeBorder(includeBorder)

Specifies if the style includes the color, color index, line style, and weight border properties.

setIncludeBorder(includeBorder: boolean): void;

Parameters

includeBorder

boolean

Returns

void

setIncludeFont(includeFont)

Specifies if the style includes the background, bold, color, color index, font style, italic, name, size, strikethrough, subscript, superscript, and underline font properties.

setIncludeFont(includeFont: boolean): void;

Parameters

includeFont

boolean

Returns

void

setIncludeNumber(includeNumber)

Specifies if the style includes the number format property.

setIncludeNumber(includeNumber: boolean): void;

Parameters

includeNumber

boolean

Returns

void

setIncludePatterns(includePatterns)

Specifies if the style includes the color, color index, invert if negative, pattern, pattern color, and pattern color index interior properties.

setIncludePatterns(includePatterns: boolean): void;

Parameters

includePatterns

boolean

Returns

void

setIncludeProtection(includeProtection)

Specifies if the style includes the formula hidden and locked protection properties.

setIncludeProtection(includeProtection: boolean): void;

Parameters

includeProtection

boolean

Returns

void

setIndentLevel(indentLevel)

An integer from 0 to 250 that indicates the indent level for the style.

setIndentLevel(indentLevel: number): void;

Parameters

indentLevel

number

Returns

void

setLocked(locked)

Specifies if the object is locked when the worksheet is protected.

setLocked(locked: boolean): void;

Parameters

locked

boolean

Returns

void

setNumberFormat(numberFormat)

The format code of the number format for the style.

setNumberFormat(numberFormat: string): void;

Parameters

numberFormat

string

Returns

void

setNumberFormatLocal(numberFormatLocal)

The localized format code of the number format for the style.

setNumberFormatLocal(numberFormatLocal: string): void;

Parameters

numberFormatLocal

string

Returns

void

setRangeBorderTintAndShade(rangeBorderTintAndShade)

Specifies a double that lightens or darkens a color for range borders. The value is between -1 (darkest) and 1 (brightest), with 0 for the original color. A null value indicates that the entire border collection doesn't have a uniform tintAndShade setting.

setRangeBorderTintAndShade(rangeBorderTintAndShade: number): void;

Parameters

rangeBorderTintAndShade

number

Returns

void

setReadingOrder(readingOrder)

The reading order for the style.

setReadingOrder(readingOrder: ReadingOrder): void;

Parameters

Returns

void

setShrinkToFit(shrinkToFit)

Specifies if text automatically shrinks to fit in the available column width.

setShrinkToFit(shrinkToFit: boolean): void;

Parameters

shrinkToFit

boolean

Returns

void

setTextOrientation(textOrientation)

The text orientation for the style.

setTextOrientation(textOrientation: number): void;

Parameters

textOrientation

number

Returns

void

setVerticalAlignment(verticalAlignment)

Specifies the vertical alignment for the style. See ExcelScript.VerticalAlignment for details.

setVerticalAlignment(verticalAlignment: VerticalAlignment): void;

Parameters

verticalAlignment
ExcelScript.VerticalAlignment

Returns

void

setWrapText(wrapText)

Specifies if Excel wraps the text in the object.

setWrapText(wrapText: boolean): void;

Parameters

wrapText

boolean

Returns

void