Functions for meetings

Updated at:

Control the visible range, cell selection, and editing state of a spreadsheet document using the JS-SDK.

Important

JS-SDK V1.1.15 and later support these features.

API overview

API

Type

Description

ActiveWindow.ScrollColumn

Property (read/write)

Index of the leftmost visible column

ActiveWindow.ScrollRow

Property (read/write)

Index of the topmost visible row

ActiveSheet.Range

Property (read)

Range object for a cell or cell range

ActiveSheet.Cells

Property (read)

Range object for all cells in the worksheet

ActiveSheet.Columns

Property (read)

Range object for all columns in the worksheet

ActiveSheet.Rows

Property (read)

Range object for all rows in the worksheet

ActiveSheet.UsedRange

Property (read)

Range object for the used range in the worksheet

ActiveSheet.Index

Property (read)

Index of the active sheet

ActiveWorkbook.QuitCellEdit()

Method

Exit cell editing mode

ActiveWorkbook.CloseDropdownPanels()

Method

Close all open drop-down panels

ActiveWorkbook.CloseHyperLink()

Method

Close the active hyperlink

ActiveWorkbook.CloseFilterTips()

Method

Close hover tips for filters

Sub.Worksheet_SelectionChange

Event

Fires when the cell selection changes

Sub.Worksheet_ScrollChange

Event

Fires when the user scrolls the worksheet

Sub.Worksheet_ForceLandscape

Event

Fires when the screen switches to landscape orientation

In all syntax entries below, Expression refers to the document type application object (instance.Application).

---

Visible range

Set or get the leftmost visible column

Get or set the index of the leftmost visible column in the spreadsheet window. Type: number — readable and writable.

  • Syntax

    Expression.ActiveWindow.ScrollColumn

    Expression: the document type application object.

  • Return value

    Returns a number that represents the leftmost column in the visible range.

  • Example

    async function example() {
      await instance.ready();
    
      const app = instance.Application;
    
      // Get the index of the leftmost visible column.
      const ScrollColumn = await app.ActiveWindow.ScrollColumn;
      console.log(ScrollColumn);
    
      // Set the index of the leftmost visible column.
      app.ActiveWindow.ScrollColumn = 10;
    }

Set or get the topmost visible row

Get or set the index of the topmost visible row in the spreadsheet window. Type: number — readable and writable.

  • Syntax

    Expression.ActiveWindow.ScrollRow

    Expression: the document type application object.

  • Return value

    Returns a number that represents the topmost row in the visible range.

  • Example

    async function example() {
      await instance.ready();
    
      const app = instance.Application;
    
      // Get the index of the topmost visible row.
      const ScrollRow = await app.ActiveWindow.ScrollRow;
      console.log(ScrollRow);
    
      // Set the index of the topmost visible row.
      app.ActiveWindow.ScrollRow = 10;
    }

Range selection

A cell or a range of cells

Get a range object that represents a cell or a cell range. Use the returned object to access range-related properties and methods.

  • Syntax

    Expression.ActiveSheet.Range

    Expression: the document type application object.

  • Example

    async function example() {
      await instance.ready();
    
      const app = instance.Application;
    
      // The worksheet object.
      const Sheet = await app.ActiveSheet;
    
      // A cell or a range of cells.
      const Range = await Sheet.Range;
    
      // Specify the cell.
      const range = await Range.Item("D2");
      // You can also use range=await Range("D2") to specify the cell.
      
      // Select cell D2.
      await range.Select();
    }

Get all cells in a worksheet

Get a range object that represents all cells in the active worksheet.

  • Syntax

    Expression.ActiveSheet.Cells

    Expression: the document type application object.

  • Example

    async function example() {
      await instance.ready();
    
      const app = instance.Application;
    
      // The worksheet object.
      const Sheet = await app.ActiveSheet;
    
      // The cell objects.
      const cells = await Sheet.Cells;
    
      // Specify the cell.
      const cell = await cells.Item(1);
      // You can also use cell=await cells(1) to specify the cell.
      
      // Select the first cell.
      await cell.Select();
    }

Get all columns in a worksheet

Get a range object that represents all columns in the active worksheet.

  • Syntax

    Expression.ActiveSheet.Columns

    Expression: the document type application object.

  • Example

    async function example() {
      await instance.ready();
    
      const app = instance.Application;
    
      // The worksheet object.
      const Sheet = await app.ActiveSheet;
    
      // The column objects.
      const Columns = await Sheet.Columns;
    
      // Specify the column.
      const column = await Columns.Item(1);
      // You can also use column=await Columns(1) to specify the column.
      
      // Select the first column.
      await column.Select();
    }

Get all rows in a worksheet

Get a range object that represents all rows in the active worksheet.

  • Syntax

    Expression.ActiveSheet.Rows

    Expression: the document type application object.

  • Example

    async function example() {
      await instance.ready();
    
      const app = instance.Application;
    
      // The worksheet object.
      const Sheet = await app.ActiveSheet;
    
      // The row objects.
      const Rows = await Sheet.Rows;
    
      // Specify the row.
      const row = await Rows.Item(1);
      // You can also use row=await Rows(1) to specify the row.
      
      // Select the first row.
      await row.Select();
    }

Get the used range in a worksheet

Get a range object that represents the used range in the active worksheet — the smallest rectangle that contains all cells with data.

  • Syntax

    Expression.ActiveSheet.UsedRange

    Expression: the document type application object.

  • Example

    async function example() {
      await instance.ready();
    
      const app = instance.Application;
    
      // The worksheet object.
      const Sheet = await app.ActiveSheet;
      
      // The used range in the worksheet.
      const UsedRange = await Sheet.UsedRange;
    
      // Select the used range.
      UsedRange.Select();
    
    }

Listen to selection change events

Register a handler that fires whenever the cell selection changes in the worksheet.

  • Syntax

    Expression.Sub.Worksheet_SelectionChange = Function

    Expression: the document type application object.

  • Example

    async function example() {
      await instance.ready();
    
      const app = instance.Application;
      
      // Listen to selection change events.
      app.Sub.Worksheet_SelectionChange = (e) => {
        console.log('SelectionChange', e);
      };
    }

Get the index of the active sheet

Get the index of the currently active sheet in the workbook. Type: number — read-only.

  • Syntax

    Expression.ActiveSheet.Index

    Expression: the document type application object.

  • Example

    async function example() {
      await instance.ready();
    
      const app = instance.Application;
      
      // The index of the active sheet.
      const Index = await app.ActiveSheet.Index;
      console.log(Index);
    }

Exit editing

Exit cell editing mode programmatically. Call this method to commit any in-progress cell edit and return focus to the sheet.

  • Syntax

    Expression.ActiveWorkbook.QuitCellEdit()

    Expression: the document type application object.

  • Example

    async function example() {
      await instance.ready();
    
      const app = instance.Application;
      
      // Exit editing.
      await app.ActiveWorkbook.QuitCellEdit();
    }

Close all open drop-down panels

Close all drop-down panels that are currently open in the spreadsheet.

  • Syntax

    Expression.ActiveWorkbook.CloseDropdownPanels()

    Expression: the document type application object.

  • Example

    async function example() {
      await instance.ready();
    
      const app = instance.Application;
      
      // Close all open drop-down panels.
      await app.ActiveWorkbook.CloseDropdownPanels();
    }

Close hyperlinks

Close the active hyperlink display in the spreadsheet.

  • Syntax

    Expression.ActiveWorkbook.CloseHyperLink()

    Expression: the document type application object.

  • Example

    async function example() {
      await instance.ready();
    
      const app = instance.Application;
      
      // Close hyperlinks.
      await app.ActiveWorkbook.CloseHyperLink();
    }

Close hover tips for filters

Close the hover tooltip that appears when the user hovers over a filter icon.

  • Syntax

    Expression.ActiveWorkbook.CloseFilterTips()

    Expression: the document type application object.

  • Example

    async function example() {
      await instance.ready();
    
      const app = instance.Application;
      
      // Close hover tips for filters.
      await app.ActiveWorkbook.CloseFilterTips();
    }

Listen to scroll events

Register a handler that fires whenever the user scrolls the worksheet.

  • Syntax

    Expression.Sub.Worksheet_ScrollChange = Function

    Expression: the document type application object.

  • Example

    async function example() {
      await instance.ready();
    
      const app = instance.Application;
      
      // Listen to scroll events.
      app.Sub.Worksheet_ScrollChange = () => {
        console.log('ScrollChange');
      };
    }

Listen to forced landscape events

Register a handler that fires when the device switches to forced landscape orientation.

  • Syntax

    Expression.Sub.Worksheet_ForceLandscape = Function

    Expression: the document type application object.

  • Example

    async function example() {
      await instance.ready();
    
      const app = instance.Application;
      
      // Listen to forced landscape events.
      app.Sub.Worksheet_ForceLandscape = (e) => {
        console.log('ForceLandscape', e);
      };
    }