Hierarchy

Hierarchy

  • Base
    • Workbook

Constructors

  • Returns Workbook

  • Parameters

    Returns Workbook

  • Parameters

    • Rest ..._rest: any[]

    Returns Workbook

Properties

$type: Type
$t: Type
maxExcel2007CellFormatCount: number
maxExcel2007ColumnCount: number
maxExcel2007RowCount: number
maxExcelCellFormatCount: number
maxExcelColumnCount: number
maxExcelRowCount: number
maxExcelWorkbookFonts: number
nextHashCode: number

Accessors

  • get calculationMode(): CalculationMode
  • Gets or sets the value which indicates how a formula will be recalculated when a referenced value changes.

    If this is set to a value of Manual, the [[recalculateBeforeSave]] property will determine if formulas are recalculated just before saving the file. Otherwise, that property is ignored.

    The value which indicates how a formula will be recalculated when a referenced value changes.

    Throws

    [[InvalidEnumArgumentException]] The assigned value is not defined in the [[calculationMode]] enumeration.

    See

    [[recalculateBeforeSave]]

    Returns CalculationMode

  • set calculationMode(a): void
  • Parameters

    Returns void

  • get cellReferenceMode(): CellReferenceMode
  • Gets or sets the value which indicates the way cells in the workbook are referenced.

    The value of this property will affect the row and columns labels of the workbook when opened in Microsoft Excel. In addition, it will affect the display of formulas referencing different cells.

    The value which indicates the way cells in the workbook are referenced.

    Throws

    [[InvalidEnumArgumentException]] The assigned value is not defined in the [[cellReferenceMode]] enumeration.

    Returns CellReferenceMode

  • set cellReferenceMode(a): void
  • Parameters

    Returns void

  • get culture(): string | CultureInfo
  • Gets or sets the culture to use as the current culture for the workbook when doing any culture-aware conversions or comparisons.

    Note: The culture is not saved or loaded in workbook files, so this is only used at when accessing and manipulating objects owned or associated with the Workbook.

    The current culture for the workbook or Null to use the thread's current culture.

    Returns string | CultureInfo

  • set culture(a): void
  • Parameters

    • a: string | CultureInfo

    Returns void

  • get currentFormat(): WorkbookFormat
  • Gets the current format of the workbook. This is the format which will be used when saving and imposing format restrictions.

    See

    [[setCurrentFormat]]

    Returns WorkbookFormat

  • get dateSystem(): DateSystem
  • Gets or sets the date system used internally by Microsoft Excel. The date system used internally by Microsoft Excel.

    Throws

    [[InvalidEnumArgumentException]] The assigned value is not defined in the [[dateSystem]] enumeration.

    Returns DateSystem

  • set dateSystem(a): void
  • Parameters

    Returns void

  • get defaultTableStyle(): WorksheetTableStyle
  • Gets or sets the default style for tables in the workbook.

    This can be set to any [[WorksheetTableStyle]] in the [[customTableStyles]] or [[standardTableStyles]] collection.

    This will never return a null value. If it is set to null, it will be reset to the TableStyleMedium2 table style.

    If this value is changed, it will not be applied to existing tables in the workbook. Only newly created tables will use default table style on the workbook.

    Throws

    [[ArgumentException]] The specified value is not in the [[customTableStyles]] or [[standardTableStyles]] collections.

    See

    • [[customTableStyles]]
    • [[standardTableStyles]]
    • [[WorksheetTable.style]]

    Returns WorksheetTableStyle

  • set defaultTableStyle(a): void
  • Parameters

    Returns void

  • get documentProperties(): DocumentProperties
  • Gets the properties associated with the workbook document.

    The document properties are pieces of information which provide details on the content of the workbook, such as the author, title, and subject of the workbook.

    The properties associated with the workbook document.

    Returns DocumentProperties

  • get editingCulture(): string | CultureInfo
  • The editing culture affects certain language specific features such as formatting of dates. or comparisons.

    Note: The EditingCulture is not saved or loaded in workbook files, so this is only used at when accessing and manipulating objects owned or associated with the Workbook.

    See

    [[culture]]

    Returns string | CultureInfo

  • set editingCulture(a): void
  • Parameters

    • a: string | CultureInfo

    Returns void

  • get hasProtectionPassword(): boolean
  • Returns a boolean indicating if the Workbook has been protected with a password.

    When protecting a Workbook, a password is optional. The HasProtectionPassword will return true if the Workbook is currently protected (see [[isProtected]]) and a password was specified when it was protected. To protect a Workbook without a password, one may use the [[protect]] method that doesn't take a password.

    See

    • [[isProtected]]
    • [[protection]]
    • [[WorkbookProtection]]
    • [[protect]]
    • [[unprotect]]

    Returns boolean

  • get isProtected(): boolean
  • Returns a boolean indicating if the Workbook has been protected.

    The IsProtected property will return true if the Workbook is currently protected. When a Workbook is protected certain operations related to the Worksheets displayed or their order or the properties of the windows for the Workbook may be restricted based on the values of the [[protection]].

    See

    • [[hasProtectionPassword]]
    • [[protection]]
    • [[WorkbookProtection]]
    • [[protect]]
    • [[unprotect]]

    Returns boolean

  • get isSaving(): boolean
  • Gets the value indicating whether the [[Workbook]] is currently being saved.

    Returns boolean

  • set isSaving(a): void
  • Parameters

    • a: boolean

    Returns void

  • get iterativeCalculationsEnabled(): boolean
  • Gets or sets the value which indicates whether iterations are allowed while calculating formulas containing circular references.

    When iterative calculations are enabled, a formula is allowed to use circular references, or directly or indirectly reference the cell to which it belongs. Microsoft Excel stops iteratively calculating formulas after iterating [[maxRecursionIterations]] times or when all formula values change by less than [[maxChangeInIteration]] between two iterations.

    When iterative calculations are disabled, circular references are not allowed, and a formula which references the cell to which it belongs, directly or indirectly, will cause Microsoft Excel to show an error message and the cell will contain a Circularity error.

    The value which indicates whether iterations are allowed while calculating recursive formulas.

    See

    • [[ErrorValue.circularity]]
    • [[maxChangeInIteration]]
    • [[maxRecursionIterations]]

    Returns boolean

  • set iterativeCalculationsEnabled(a): void
  • Parameters

    • a: boolean

    Returns void

  • get maxChangeInIteration(): number
  • Gets or sets the maximum change of the values in a formula between iterations which will exit from iteration.

    This property is only valid when [[iterativeCalculationsEnabled]] is True. Otherwise it is ignored.

    When iterative calculations, or circular references, are enabled, this property determines the maximum change in all values of a formula between two iterations that will cause the formula to exit iterative calculations. Iterative calculations will also be stopped if the formula iterates [[maxRecursionIterations]] times.

    The maximum change of the values in a formula between iterations which will exit from iteration.

    See

    • [[iterativeCalculationsEnabled]]
    • [[maxRecursionIterations]]

    Returns number

  • set maxChangeInIteration(a): void
  • Parameters

    • a: number

    Returns void

  • get maxColumnCount(): number
  • Gets the maximum number of columns allowed in each worksheet based on the [[currentFormat]].

    Returns number

  • get maxRecursionIterations(): number
  • Gets or sets the maximum number of times formulas should be iteratively calculated.

    This property is only valid when [[iterativeCalculationsEnabled]] is True. Otherwise it is ignored.

    When iterative calculations, or circular references, are enabled, this property determines the number of iterations allowed when calculating iteratively.

    The maximum number of times formulas should be iteratively calculated.

    Throws

    [[ArgumentOutOfRangeException]] The assigned value is outside the valid range of 1 and 32767.

    See

    • [[iterativeCalculationsEnabled]]
    • [[maxChangeInIteration]]

    Returns number

  • set maxRecursionIterations(a): void
  • Parameters

    • a: number

    Returns void

  • get maxRowCount(): number
  • Gets the maximum number of rows allowed in each worksheet based on the [[currentFormat]].

    Returns number

  • get precision(): Precision
  • Gets or sets the precision to use when obtaining a cell's value.

    The precision determines whether to use the actual value of the cell or the display value of the cell. These are typically the same, but the format of a cell could cause a loss of precision in the displayed value. For example, if a cell's value is 18.975, and a currency format is used for the cell, the display value will be 18.98.

    The precision to use when obtaining a cell's value.

    Throws

    [[InvalidEnumArgumentException]] The assigned value is not defined in the enumeration.

    Returns Precision

  • set precision(a): void
  • Parameters

    Returns void

  • get protection(): WorkbookProtection
  • Returns an object that provides information used when the Workbook has been protected.

    See

    • [[hasProtectionPassword]]
    • [[isProtected]]
    • [[WorkbookProtection]]
    • [[protect]]
    • [[unprotect]]

    Returns WorkbookProtection

  • get recalculateBeforeSave(): boolean
  • Gets or sets the value which indicates whether the workbook should recalculate all formulas before saving.

    This property only applies if the [[calculationMode]] is set to Manual. Otherwise, it is ignored.

    The value which indicates whether the workbook should recalculate all formulas before saving.

    See

    • [[recalculate]]
    • [[calculationMode]]

    Returns boolean

  • set recalculateBeforeSave(a): void
  • Parameters

    • a: boolean

    Returns void

  • get saveExternalLinkedValues(): boolean
  • Gets or sets the value which indicates whether to save values linked from external workbooks.

    This value will only be used when the workbook is opened in Microsoft Excel. When referencing external values and saving a workbook through the Excel assembly, external linked values will never be saved.

    The value which indicates whether to save values linked from external workbooks.

    Returns boolean

  • set saveExternalLinkedValues(a): void
  • Parameters

    • a: boolean

    Returns void

  • get screenDpi(): IgSize
  • Gets or sets the Dpi to use when calculating row and column sizes for the workbook. If empty, the system Dpi will be used.

    Throws

    [[ArgumentException]] Occurs when the specified value is not empty and does not have two positive values.

    Returns IgSize

  • set screenDpi(a): void
  • Parameters

    • a: IgSize

    Returns void

  • get shouldRemoveCarriageReturnsOnSave(): boolean
  • Gets or sets the value which indicates whether carriage return characters should be removed from string values in cells when the workbook is saved to an Excel file.

    In Microsoft Excel 2003, carriage return characters are displayed as boxes. Most of the time, this should not be seen and removing the carriage return characters has no adverse effect on the layout of the text within a cell. Therefore, this property is True by default.

    True if the saved workbook file should not contain the carriage return characters from cell values; False to export the string values as they have been set on the cells.

    Returns boolean

  • set shouldRemoveCarriageReturnsOnSave(a): void
  • Parameters

    • a: boolean

    Returns void

  • get validateFormatStrings(): boolean
  • Gets or sets the value indicating whether the format strings should be validated when they are set.

    This value is False by default to maintain backward compatibility.

    When True, format strings will be validated when a [[IWorksheetCellFormat.formatString]] property is set. An invalid format string will cause an exception. When False, invalid format strings will be allowed, but if the display text of a cell is requested, an exception will be thrown at that time. If invalid format strings are allowed and the workbook is saved and opened in Microsoft Excel, it will show an error.

    See

    • [[IWorksheetCellFormat.formatString]]
    • [[WorksheetCell.getText]]
    • [[WorksheetCell.getText]]
    • [[WorksheetRow.getCellText]]
    • [[WorksheetRow.getCellText]]

    Returns boolean

  • set validateFormatStrings(a): void
  • Parameters

    • a: boolean

    Returns void

  • get windowOptions(): WorkbookWindowOptions
  • Gets the options which control various workbook level display properties.

    The window options control properties of the child MDI window showing the workbook in Microsoft Excel. They also control display options of the workbook which do not change based on the selected worksheet.

    The options which control various workbook level display properties.

    See

    [[CustomView.windowOptions]]

    Returns WorkbookWindowOptions

  • get systemDpi(): IgSize
  • Gets or sets the default Dpi to use when calculating row and column sizes for the workbook. If empty, the resolved system Dpi will be used.

    Returns IgSize

  • set systemDpi(a): void
  • Parameters

    • a: IgSize

    Returns void

Methods

  • Returns IEnumerable$1<KeyValuePair$2<string, number[]>>

  • Converts units of 1/256s of the average character width to pixels.

    The units of 1/256s of the average character width are based on the font height of the normal style.

    See

    • [[pixelsToCharacterWidth256ths]]
    • [[WorksheetColumn.width]]
    • [[Worksheet.defaultColumnWidth]]

    Parameters

    • characterWidth256ths: number

      The number of units of 1/256s of the average character width.

    Returns number

  • Clears all external data connections from the [[Workbook]].

    Returns void

  • Clears all pivot tables and associated slicers from the [[Workbook]].

    Returns void

  • Clears all vba information from the [[Workbook]].

    Returns void

  • Factory method which creates new workbook font.

    [[IWorkbookFont]] describes font used in excel workbook. If many parts of excel workbook have same and complex (more than one property in common) font formatting, use this method in following manner:

    1. Create new font format with [[createNewWorkbookFont]],
    2. Set all necessary properties on given font format,
    3. Apply font format to all excel objects which use it with [[IWorkbookFont.setFontFormatting]] method.

    Use of this procedure will simplify you code for complex font formats and increase speed of resulting program. It will not reduce total number of font formats in a workbook as font formats are internally cached no matter which method is used.

    Returns IWorkbookFont

  • Creates new worksheet cell format.

    [[IWorksheetCellFormat]] describes cell specific formatting (font, number format, appearance etc.). Total number of different cell formats in excel workbook is limited to [[Workbook.maxExcelCellFormatCount]]. If many parts of excel workbook have same and complex (more than one property in common) cell formatting, use this method in following manner:

    1. Create new cell format with [[createNewWorksheetCellFormat]],
    2. Set all necessary properties on given cell format,
    3. Apply cell format to all excel objects which use it with [[IWorksheetCellFormat.setFormatting]] method.

    Use of this procedure will simplify you code for complex cell formats and increase speed of resulting program. It will not reduce total number of cell formats in a workbook as cell formats are internally cached no matter which method is used.

    Returns IWorksheetCellFormat

  • Gets the [[WorksheetTableStyle]] at the specified index.

    Throws

    [[ArgumentOutOfRangeException]] 'index' is less than 0 or greater than or equal to [[count]].

    Parameters

    • index: number

      The index at which to get the WorksheetTableStyle.

    Returns WorksheetTableStyle

  • Gets the [[WorksheetTableStyle]] with the specified name.

    Table style names are compared case-insensitively.

    Parameters

    • name: string

      The name of the WorksheetTableStyle to find.

    Returns WorksheetTableStyle

  • Gets the collection of custom table styles in the workbook.

    See

    • [[defaultTableStyle]]
    • [[standardTableStyles]]

    Returns CustomTableStyleCollection

  • Gets the custom view at the specified index. The custom view at the specified index.

    Throws

    [[ArgumentOutOfRangeException]] 'index' is less than zero or 'index' is greater than or equal to [[count]].

    Parameters

    • index: number

      The zero-based index of the custom view to get.

    Returns CustomView

  • Gets the collection of custom views for the workbook.

    Each custom view stores display settings and optionally print settings, which can later be applied to the workbook and its worksheets as one operation, through both the Microsoft Excel UI and the Excel assembly by calling the [[CustomView.apply]] method.

    The collection of custom views for the workbook.

    See

    [[CustomView]]

    Returns CustomViewCollection

  • Parameters

    • other: any

    Returns boolean

  • Returns number

  • Gets the table with the specified name.

    Table names are compared case-insensitively.

    Parameters

    • name: string

      The name of the table to get.

    Returns WorksheetTable

  • Gets a value indicating whether the specified function will be recognized and solved by Microsoft Excel when the workbook is saved out.

    Parameters

    • functionName: string

      The case-insensitive name of the function.

    Returns boolean

  • Returns Base

  • Gets the named reference at the specified index. The named reference at the specified index.

    Throws

    [[ArgumentOutOfRangeException]] 'index' is less than zero or 'index' is greater than or equal to [[count]].

    Parameters

    • index: number

      The zero-based index of the named reference to get.

    Returns NamedReference

  • Gets the collection of named references in the workbook.

    Named references are typically used to refer to cells or ranges of cells by name. The named reference names are used by formulas instead of explicitly naming the cells or cell ranges.

    The collection of named references in the workbook.

    See

    [[NamedReference]]

    Returns NamedReferenceCollection

  • Gets or sets a color in the palette.

    When a color is set in the palette, [[isCustom]] will return True. The palette can than be reset with the [[reset]] method.

    Colors added to the palette must be opaque.

    Throws

    [[ArgumentOutOfRangeException]] 'index' is less than 0 or greater than 55.

    Throws

    [[ArgumentException]] The value assigned is an empty color, a system color, or is not opaque.

    See

    • [[isCustom]]
    • [[reset]]

    Parameters

    • index: number

      The index of the color to get or set in the palette.

    • Optional value: string | Color

    Returns string

  • Gets the color palette used when the saved file is opened in Microsoft Excel 2003 and earlier versions.

    When the file is opened in Microsoft Excel 2003 and earlier versions, the actual colors used in cells and shapes may not be displayed. Instead, the closest color in the palette will be displayed instead. Therefore, the palette can be customized if necessary to keep the colors as accurate as possible in older versions of Excel.

    Returns WorkbookColorPalette

  • Converts pixels to units of 1/256s of the average character width.

    The units of 1/256s of the average character width are based on the font height of the normal style.

    See

    • [[characterWidth256thsToPixels]]
    • [[WorksheetColumn.width]]
    • [[Worksheet.defaultColumnWidth]]

    Parameters

    • pixels: number

      The number of pixels.

    Returns number

  • Protects the Workbook without a password.

    When a Workbook is protected without a password, the end user may unprotect the Workbook in Excel without having to supply a password. To programatically unprotect a Workbook, one may use the [[unprotect]] method.

    When a Workbook is protected, the values of the properties of the [[WorkbookProtection]] instance from this Workbook's [[protection]] property indicate the disabled operations.

    Note: If [[isProtected]] is already true, the method will be ignored.

    See

    • [[hasProtectionPassword]]
    • [[isProtected]]
    • [[protection]]
    • [[WorkbookProtection]]
    • [[unprotect]]

    Parameters

    • Optional allowEditStructure: boolean

      Optional boolean indicating the new value for the [[WorkbookProtection.allowEditStructure]].

    • Optional allowEditWindows: boolean

      Optional boolean indicating the new value for the [[WorkbookProtection.allowEditWindows]].

    Returns void

  • Recalculates all dirty formulas pending a calculation on the workbook.

    This can be used when the [[calculationMode]] is Manual. In Manual mode, when cells are dirtied, formulas referencing those cells will not be recalculated until Recalculate is called or [[recalculateBeforeSave]] is True and the workbook is saved.

    To force a recalculation of non-dirty formulas, use the [[recalculate]] overload and specify True for the includeNonDirtyFormulas parameter.

    See

    • [[calculationMode]]
    • [[recalculateBeforeSave]]

    Returns void

  • Recalculates all formulas on the workbook.

    This can be used when the [[calculationMode]] is Manual. In Manual mode, when cells are dirtied, formulas referencing those cells will not be recalculated until Recalculate is called or [[recalculateBeforeSave]] is True and the workbook is saved.

    See

    • [[calculationMode]]
    • [[recalculateBeforeSave]]

    Parameters

    • includeNonDirtyFormulas: boolean

      True to recalculate all formulas on the workbook regardless of whether they had a pending evaluation. False to only calculate dirty formulas.

    Returns void

  • Recalculates all formulas on the workbook.

    This can be used when the [[calculationMode]] is Manual. In Manual mode, when cells are dirtied, formulas referencing those cells will not be recalculated until Recalculate is called or [[recalculateBeforeSave]] is True and the workbook is saved.

    See

    • [[calculationMode]]
    • [[recalculateBeforeSave]]

    Parameters

    • includeNonDirtyFormulas: boolean

      True to recalculate all formulas on the workbook regardless of whether they had a pending evaluation. False to only calculate dirty formulas.

    Returns void

  • Registers a single [[ExcelCalcFunction]] instance.

    Users can build custom functions used in formulas by sub-classing the [[ExcelCalcFunction]] class. Once the derived class is instantiated it must be registered by using the RegisterUserDefinedFunction method before being available and referenced by a formulas.

    Parameters

    Returns boolean

  • Registers a custom function.

    Parameters

    • name: string

      The name of the function

    • minArgs: number

      The minimum number of arguments

    • maxArgs: number

      The maximum number of arguments

    • evaluate: ((arg1, arg2) => ExcelCalcValue)

      The function used to perform the calculation that gets an [[ExcelCalcNumberStack]] and the number of arguments on the stack for the function and returns an [[ExcelCalcValue]] that represents the result of the formula

    Returns boolean

  • Resumes the calculation of formulas.

    If calculations were not suspended when this is called, it will have no effect.

    For each call to [[suspendCalculations]], a call to ResumeCalculations must be made. As soon as the number of calls to ResumeCalculations equals the number of calls to SuspendCalculations, calculations will be resumed.

    See

    [[suspendCalculations]]

    Returns void

  • Writes the workbook to a Uint8Array.

    The workbook will be written in the format specified by the [[currentFormat]].

    Throws

    [[InvalidOperationException]] The workbook has no worksheets in its [[worksheets]] collection.

    Throws

    [[InvalidOperationException]] No worksheet in this workbook's Worksheets collection has its DisplayOptions.Visibility set to Visible.

    Throws

    [[InvalidOperationException]] A [[CustomView]] in the workbook's [[customViews]] collection has all worksheets hidden. At least one worksheet must be visible in all custom views.

    See

    [[isSaving]]

    Parameters

    • saveOptions: WorkbookSaveOptions

      The options to use to save the stream or null to use the default options.

    • successCallback: ((arg1) => void)

      The function to call when the Workbook has been successfully saved into a Uint8Array or base-64 encoded string.

        • (arg1): void
        • Parameters

          • arg1: any

          Returns void

    • failCallback: ((arg1) => void)

      The function to call when saving the Workbook has caused an error.

        • (arg1): void
        • Parameters

          • arg1: BaseError

          Returns void

    Returns void

  • Writes the workbook to a Uint8Array.

    The workbook will be written in the format specified by the [[currentFormat]].

    Throws

    [[InvalidOperationException]] The workbook has no worksheets in its [[worksheets]] collection.

    Throws

    [[InvalidOperationException]] No worksheet in this workbook's Worksheets collection has its DisplayOptions.Visibility set to Visible.

    Throws

    [[InvalidOperationException]] A [[CustomView]] in the workbook's [[customViews]] collection has all worksheets hidden. At least one worksheet must be visible in all custom views.

    See

    [[isSaving]]

    Parameters

    • successCallback: ((arg1) => void)

      The function to call when the Workbook has been successfully saved into a Uint8Array or base-64 encoded string.

        • (arg1): void
        • Parameters

          • arg1: any

          Returns void

    • failCallback: ((arg1) => void)

      The function to call when saving the Workbook has caused an error.

        • (arg1): void
        • Parameters

          • arg1: BaseError

          Returns void

    Returns void

  • Sets the current format of the workbook.

    Throws

    [[InvalidEnumArgumentException]] 'format' is not defined in the [[WorkbookFormat]] enumeration.

    Throws

    [[InvalidOperationException]] The workbook already contains data which exceeds the limits imposed by 'format'.

    See

    [[currentFormat]]

    Parameters

    • format: WorkbookFormat

      The file format to use when imposing format restrictions and saving.

    Returns void

  • Gets the sheet at the specified index. The sheet at the specified index.

    Throws

    [[ArgumentOutOfRangeException]] 'index' is less than zero or 'index' is greater than or equal to [[count]].

    Parameters

    • index: number

      The zero-based index of the sheet to get.

    Returns Sheet

  • Gets the sheet with the specified name.

    Sheet names are compared case-insensitively.

    The sheet with the specified name.

    Throws

    [[InvalidOperationException]] A sheet with the specified name does not exist in the collection.

    See

    [[Sheet.name]]

    Parameters

    • name: string

      The name of the sheet to get.

    Returns Sheet

  • Gets the collection of sheets in the workbook.

    Use WindowOptions.SelectedSheet to set the selected sheet. The selected sheet is the sheet seen when the workbook is opened in Microsoft Excel.

    The collection of worksheets in the workbook.

    Returns SheetCollection

  • Gets the [[WorksheetTableStyle]] at the specified index.

    Throws

    [[ArgumentOutOfRangeException]] 'index' is less than 0 or greater than or equal to [[count]].

    Parameters

    • index: number

      The index at which to get the WorksheetTableStyle.

    Returns WorksheetTableStyle

  • Gets the [[WorksheetTableStyle]] with the specified name.

    Table style names are compared case-insensitively.

    Parameters

    • name: string

      The name of the WorksheetTableStyle to find.

    Returns WorksheetTableStyle

  • Gets the read-only collection of preset table styles in the workbook.

    See

    • [[defaultTableStyle]]
    • [[customTableStyles]]

    Returns StandardTableStyleCollection

  • Gets the style at the specified index. The style at the specified index.

    Throws

    [[ArgumentOutOfRangeException]] 'index' is less than zero or 'index' is greater than or equal to [[count]].

    Parameters

    • index: number

      The zero-based index of the style to get.

    Returns WorkbookStyle

  • Gets the style with the specified name.

    Style names are compared case-insensitively.

    The style with the specified name or null if no style with that name exists.

    Throws

    [[ArgumentNullException]] 'name' is null.

    Parameters

    • name: string

      The name of the style to get.

    Returns WorkbookStyle

  • Gets the collection of custom styles in the workbook.

    Use this collection to add custom styles to Excel workbook. The user can apply those styles to different parts of excel workbook and thereby set complex formatting with ease.

    The collection of custom styles in the workbook.

    See

    [[WorkbookStyle]]

    Returns WorkbookStyleCollection

  • Temporarily suspends the calculation of formulas.

    This should be used when adding many formulas or modifying large amounts of data on a workbook at once so formulas are not calculated each time cells are dirtied.

    For each call to SuspendCalculations, a call to [[resumeCalculations]] must be made. As soon as the number of calls to ResumeCalculations equals the number of calls to SuspendCalculations, calculations will be resumed.

    See

    [[resumeCalculations]]

    Returns void

  • Removes the Workbook protection.

    See

    • [[isProtected]]
    • [[hasProtectionPassword]]
    • [[protect]]

    Returns void

  • Gets the worksheet at the specified index. The worksheet at the specified index.

    Throws

    [[ArgumentOutOfRangeException]] 'index' is less than zero or 'index' is greater than or equal to [[count]].

    Parameters

    • index: number

      The zero-based index of the worksheet to get.

    Returns Worksheet

  • Gets the worksheet with the specified name.

    Worksheet names are compared case-insensitively.

    The worksheet with the specified name.

    Throws

    [[InvalidOperationException]] A worksheet with the specified name does not exist in the collection.

    See

    [[Sheet.name]]

    Parameters

    • name: string

      The name of the worksheet to get.

    Returns Worksheet

  • Gets the collection of worksheets in the workbook.

    Use WindowOptions.SelectedWorksheet to set the selected worksheet. The selected worksheet is the worksheet seen when the workbook is opened in Microsoft Excel.

    The collection of worksheets in the workbook.

    Returns WorksheetCollection

  • Parameters

    • item1: any
    • item2: any

    Returns number

  • Parameters

    • item1: any
    • item2: any

    Returns number

  • Parameters

    • item1: any
    • item2: any

    Returns boolean

  • Parameters

    • a: any
    • b: any

    Returns boolean

  • Parameters

    • obj: any

    Returns any[]

  • Parameters

    • obj: any

    Returns any[]

  • Parameters

    • obj: any

    Returns number

  • Returns the number of columns that are supported by the specified format.

    Parameters

    Returns number

  • Returns the number of rows that are supported by the specified format.

    Parameters

    Returns number

  • Returns the WorkbookFormat based on the file extension of the specified file.

    Parameters

    • fileName: string

      The filename of an excel file.

    Returns WorkbookFormat

  • Determines whether the workbook in the specified stream is encrypted with an open password.

    Throws

    [[ArgumentNullException]] Occurs when 'stream' is null.

    Parameters

    • stream: string | Uint8Array

      The stream to check for encryption.

    Returns boolean

  • Loads a workbook from a File.

    When loading the workbook, the contents of the file will be examined to try to determine the format. The [[currentFormat]] of the resulting workbook will indicate the format the workbook was loaded from.

    Throws

    [[ArgumentException]] 'file' does not contain valid Microsoft Excel file contents.

    Throws

    [[ArgumentException]] The file format cannot be determined from the specified stream.

    Throws

    [[InvalidOperationException]] The format of the workbook data is in an unsupported format.

    Throws

    [[NotSupportedException]] The workbook being loaded is in an Excel 2007 format and the CLR 2.0 Excel assembly is being used. The overload taking an [[IPackageFactory]] must be used in this case so the Excel 2007 file package can be accessed.

    Throws

    [[DocumentEncryptedException]] Occurs when the workbook is encrypted.

    Parameters

    • file: File

      The file from which to load the workbook.

    • loadOptions: WorkbookLoadOptions

      The options to use to load the stream or null to use the default options.

    • successCallback: ((arg1) => void)

      The function to call when the Workbook has been successfully loaded.

        • (arg1): void
        • Parameters

          Returns void

    • failCallback: ((arg1) => void)

      The function to call when loading the Workbook has resulted in an error.

        • (arg1): void
        • Parameters

          • arg1: any

          Returns void

    Returns void

  • Loads a workbook from a File.

    When loading the workbook, the contents of the file will be examined to try to determine the format. The [[currentFormat]] of the resulting workbook will indicate the format the workbook was loaded from.

    Throws

    [[ArgumentException]] 'file' does not contain valid Microsoft Excel file contents.

    Throws

    [[ArgumentException]] The file format cannot be determined from the specified stream.

    Throws

    [[InvalidOperationException]] The format of the workbook data is in an unsupported format.

    Throws

    [[NotSupportedException]] The workbook being loaded is in an Excel 2007 format and the CLR 2.0 Excel assembly is being used. The overload taking an [[IPackageFactory]] must be used in this case so the Excel 2007 file package can be accessed.

    Throws

    [[DocumentEncryptedException]] Occurs when the workbook is encrypted.

    Parameters

    • file: File

      The file from which to load the workbook.

    • successCallback: ((arg1) => void)

      The function to call when the Workbook has been successfully loaded.

        • (arg1): void
        • Parameters

          Returns void

    • failCallback: ((arg1) => void)

      The function to call when loading the Workbook has resulted in an error.

        • (arg1): void
        • Parameters

          • arg1: any

          Returns void

    Returns void

  • Loads a workbook from a Uint8Array or base64 encoded string.

    When loading the workbook, the contents of the file will be examined to try to determine the format. The [[currentFormat]] of the resulting workbook will indicate the format the workbook was loaded from.

    Throws

    [[ArgumentException]] 'data' does not contain valid Microsoft Excel file contents.

    Throws

    [[ArgumentException]] The file format cannot be determined from the specified stream.

    Throws

    [[InvalidOperationException]] The format of the workbook data is in an unsupported format.

    Throws

    [[NotSupportedException]] The workbook being loaded is in an Excel 2007 format and the CLR 2.0 Excel assembly is being used. The overload taking an [[IPackageFactory]] must be used in this case so the Excel 2007 file package can be accessed.

    Throws

    [[DocumentEncryptedException]] Occurs when the workbook is encrypted.

    Parameters

    • data: string | Uint8Array

      The data from which to load the workbook.

    • loadOptions: WorkbookLoadOptions

      The options to use to load the stream or null to use the default options.

    • successCallback: ((arg1) => void)

      The function to call when the Workbook has been successfully loaded.

        • (arg1): void
        • Parameters

          Returns void

    • failCallback: ((arg1) => void)

      The function to call when loading the Workbook has resulted in an error.

        • (arg1): void
        • Parameters

          • arg1: BaseError

          Returns void

    Returns void

  • Loads a workbook from a Uint8Array or base64 encoded string.

    When loading the workbook, the contents of the file will be examined to try to determine the format. The [[currentFormat]] of the resulting workbook will indicate the format the workbook was loaded from.

    Throws

    [[ArgumentException]] 'data' does not contain valid Microsoft Excel file contents.

    Throws

    [[ArgumentException]] The file format cannot be determined from the specified stream.

    Throws

    [[InvalidOperationException]] The format of the workbook data is in an unsupported format.

    Throws

    [[NotSupportedException]] The workbook being loaded is in an Excel 2007 format and the CLR 2.0 Excel assembly is being used. The overload taking an [[IPackageFactory]] must be used in this case so the Excel 2007 file package can be accessed.

    Throws

    [[DocumentEncryptedException]] Occurs when the workbook is encrypted.

    Parameters

    • data: string | Uint8Array

      The data from which to load the workbook.

    • successCallback: ((arg1) => void)

      The function to call when the Workbook has been successfully loaded.

        • (arg1): void
        • Parameters

          Returns void

    • failCallback: ((arg1) => void)

      The function to call when loading the Workbook has resulted in an error.

        • (arg1): void
        • Parameters

          • arg1: BaseError

          Returns void

    Returns void

  • Parameters

    • a: any
    • b: any

    Returns boolean

  • Returns void