Excel.TableSelectionChangedEventArgs interface

Provides information about the table that raised the selection changed event.

Remarks

[ API set: ExcelApi 1.7 ]

Properties

address

Gets the range address that represents the selected area of the table on a specific worksheet.

isInsideTable

Specifies if the selection is inside a table. IsInsideTable must be set to true for the address to be useful.

tableId

Gets the ID of the table in which the selection changed.

type

Gets the type of the event. See Excel.EventType for details.

worksheetId

Gets the ID of the worksheet in which the selection changed.

Property Details

address

Gets the range address that represents the selected area of the table on a specific worksheet.

address: string;

Property Value

string

Remarks

[ API set: ExcelApi 1.7 ]

Examples

// Link to full sample: https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/excel/30-events/events-table-changed.yaml

async function onSelectionChange(args) {
    await Excel.run(async (context) => {
        console.log("Handler for table onSelectionChanged event has been triggered. The new selection is: " + args.address);
    });
}

isInsideTable

Specifies if the selection is inside a table. IsInsideTable must be set to true for the address to be useful.

isInsideTable: boolean;

Property Value

boolean

Remarks

[ API set: ExcelApi 1.7 ]

tableId

Gets the ID of the table in which the selection changed.

tableId: string;

Property Value

string

Remarks

[ API set: ExcelApi 1.7 ]

type

Gets the type of the event. See Excel.EventType for details.

type: "TableSelectionChanged";

Property Value

"TableSelectionChanged"

Remarks

[ API set: ExcelApi 1.7 ]

worksheetId

Gets the ID of the worksheet in which the selection changed.

worksheetId: string;

Property Value

string

Remarks

[ API set: ExcelApi 1.7 ]