次の方法で共有


Excel.WorksheetCalculatedEventArgs interface

計算イベントを発生させたワークシートに関する情報を提供します。

注釈

[ API セット: ExcelApi 1.8 ]

async function registerOnCalculatedHandler() {
    await Excel.run(async (context) => {
        let sheet = context.workbook.worksheets.getItem("Sample");
        sheet.onCalculated.add(onCalculated);
        await context.sync();
    });
}

async function onCalculated(event: Excel.WorksheetCalculatedEventArgs) {
    await Excel.run(async (context) => {
        // `event.address` returns the address of the range that completed calculation.
        // If multiple ranges completed calculation, the string is a comma-separated list of those range addresses.
        console.log(`The Range ${event.address} has recalculated.`);
    });
}

プロパティ

type

イベントの種類を取得します。 詳細は「Excel.EventType」をご覧ください。

worksheetId

計算が行われたワークシートの ID を取得します。

プロパティの詳細

type

イベントの種類を取得します。 詳細は「Excel.EventType」をご覧ください。

type: "WorksheetCalculated";

プロパティ値

"WorksheetCalculated"

注釈

[ API セット: ExcelApi 1.8 ]

worksheetId

計算が行われたワークシートの ID を取得します。

worksheetId: string;

プロパティ値

string

注釈

[ API セット: ExcelApi 1.8 ]