Excel.WorksheetCalculatedEventArgs interface
提供有关引发计算事件的工作表的信息。
注解
示例
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.`);
});
}
属性
| address | 完成计算的范围的地址。 如果多个区域已完成计算,则字符串是这些范围地址的逗号分隔列表。 |
| type | 获取事件的类型。 有关详细信息,请参阅 |
| worksheet |
获取进行计算的工作表的 ID。 |
属性详细信息
address
type
获取事件的类型。 有关详细信息,请参阅 Excel.EventType。
type: "WorksheetCalculated";
属性值
"WorksheetCalculated"