Options
All
  • Public
  • Public/Protected
  • All
Menu

Represents the Excel application process.

Hierarchy

  • ExcelApplication

Index

Properties

adapter: ExcelAdapter

Adapter process running in the background that functions as an intermediary between the client-side API and Microsoft’s Excel Interop API.

Methods

  • Creates a new Excel workbook.

    throws

    AdapterError if an exception is thrown by the adapter process, typically by the Excel PIA.

    Returns Promise<ExcelWorkbook>

    The workbook that was created.

  • Gets all workbooks currently open in Excel.

    throws

    AdapterError if an exception is thrown by the adapter process, typically by the Excel PIA.

    Returns Promise<ExcelWorkbook[]>

    All currently open workbooks.

  • Opens a workbook from a given file path.

    If the workbook file is already open in Excel, the existing Excel window will be given focus.

    throws

    AdapterError if no workbook file was found at the given file path, or if an exception is thrown by the adapter process, typically by the Excel PIA.

    Parameters

    • filePath: string

      Absolute path where the workbook file is located.

    Returns Promise<ExcelWorkbook>

    The workbook that was opened.

  • quit(displayAlerts?: boolean): Promise<void>
  • Quits Excel closing all open workbooks in the process.

    If any open workbooks have unsaved changes, Excel displays a "Save" prompt before closing the workbook. You can prevent this by either saving all open workbooks prior to calling quit or by setting the displayAlerts parameter to false (be careful doing this though, any unsaved workbook changes will be lost).

    After calling this function do not attempt to use any existing workbook or worksheet objects. Doing so will likely result in an AdapterError since the underlying object/file is no longer available.

    throws

    AdapterError if an exception is thrown by the adapter process, typically by the Excel PIA.

    Parameters

    • Optional displayAlerts: boolean

      Determines whether Excel will display a "Save" prompt for any workbooks with unsaved changes (defaults to true).

    Returns Promise<void>

Generated using TypeDoc