This topic describes how to set the numbers of specified rows or columns, and exit the editing mode of a visible range in a table document.
JS-SDK V1.1.15 and later support these features.
Visible range
Set or obtain column numbers
Set or obtain the number of the leftmost column in the visible range.
Syntax
Expression.ActiveWindow.ScrollColumnExpression: the document type application object.
Return value
Returns a
numberthat represents the leftmost column in the visible range.Example
async function example() { await instance.ready(); const app = instance.Application; // Obtain the number of the leftmost column. const ScrollColumn = await app.ActiveWindow.ScrollColumn; console.log(ScrollColumn); // Set the number of the leftmost column. app.ActiveWindow.ScrollColumn = 10; }
Set or obtain row numbers
Set or obtain the number of the topmost row in the visible range.
Syntax
Expression.ActiveWindow.ScrollRowExpression: the document type application object.
Return value
Returns a
numberthat represents the topmost row in the visible range.Example
async function example() { await instance.ready(); const app = instance.Application; // Obtain the number of the topmost row. const ScrollRow = await app.ActiveWindow.ScrollRow; console.log(ScrollRow); // Set the number of the topmost row. app.ActiveWindow.ScrollRow = 10; }
Range selection
A cell or a range of cells
Obtain a range object that represents a cell or a range of cells. You can use the properties and methods that are related to the range object.
Syntax
Expression.ActiveSheet.RangeExpression: 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(); }
Obtain the cells in a worksheet
Obtains a range object that represents the cells in a worksheet. You can use the properties and methods that are related to the range object.
Syntax
Expression.ActiveSheet.CellsExpression: 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(); }
Obtain the columns in a worksheet
Obtains a range object that represents the columns in a worksheet. You can use the properties and methods that are related to the range object.
Syntax
Expression.ActiveSheet.ColumnsExpression: 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 rows in a worksheet
Obtain a range object that represents the rows in a worksheet. You can use the properties and methods that are related to the range object.
Syntax
Expression.ActiveSheet.RowsExpression: 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(); }
Obtain the used range in a worksheet
Obtain a range object that represents the used range in a worksheet. You can use the properties and methods that are related to the range object.
Syntax
Expression.ActiveSheet.UsedRangeExpression: the document type application object.
Example
async function example() { await instance.ready(); const app = instance.Applictaion; // 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
Syntax
Expression.Sub.Worksheet_SelectionChange = FunctionExpression: 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); }; }
Obtain the index of the active sheet
Syntax
Expression.ActiveSheet.IndexExpression: the document type application object.
Example
async function example() { await instance.ready(); const app = instance.Applictaion; // The index of the active sheet. const Index = await app.ActiveSheet.Index; console.log(Index); }
Exit editing
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 opened drop-down panels
Syntax
Expression.ActiveWorkbook.CloseDropdownPanels()Expression: the document type application object.
Example
async function example() { await instance.ready(); const app = instance.Application; // Close all opened drop-down panels. await app.ActiveWorkbook.CloseDropdownPanels(); }
Close hyperlinks
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
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 behaviors
Syntax
Expression.Sub.Worksheet_ScrollChange = FunctionExpression: the document type application object.
Example
async function example() { await instance.ready(); const app = instance.Application; // Listen to the user's own scroll behaviors. app.Sub.Worksheet_ScrollChange = () => { console.log('ScrollChange'); }; }
Listen to forced landscape events
Syntax
Expression.Sub.Worksheet_ForceLandscape = FunctionExpression: the document type application object.
Example
async function example() { await instance.ready(); const app = instance.Application; // Listen to notifications when the landscape screen is forced. app.Sub.Worksheet_ForceLandscape = (e) => { console.log('ForceLandscape', e); }; }