Excel.WorksheetAddedEventArgs interface

提供有关引发添加的事件的工作表的信息。Provides information about the worksheet that raised the Added event.

[API 集: ExcelApi 1.7][ API set: ExcelApi 1.7 ]

属性

source

获取事件源。Gets the source of the event. 有关详细信息,请参阅 Excel.EventSource。See Excel.EventSource for details.

[API 集: ExcelApi 1.7][ API set: ExcelApi 1.7 ]

type

获取事件的类型。Gets the type of the event. 有关详细信息,请参阅 Excel.EventType。See Excel.EventType for details.

[API 集: ExcelApi 1.7][ API set: ExcelApi 1.7 ]

worksheetId

获取已添加至工作簿的工作表的 ID。Gets the id of the worksheet that is added to the workbook.

[API 集: ExcelApi 1.7][ API set: ExcelApi 1.7 ]

属性详细信息

source

获取事件源。Gets the source of the event. 有关详细信息,请参阅 Excel.EventSource。See Excel.EventSource for details.

[API 集: ExcelApi 1.7][ API set: ExcelApi 1.7 ]

source: Excel.EventSource | "Local" | "Remote";

属性值

Excel.EventSource | "Local" | "Remote"

type

获取事件的类型。Gets the type of the event. 有关详细信息,请参阅 Excel.EventType。See Excel.EventType for details.

[API 集: ExcelApi 1.7][ API set: ExcelApi 1.7 ]

type: "WorksheetAdded";

属性值

"WorksheetAdded"

worksheetId

获取已添加至工作簿的工作表的 ID。Gets the id of the worksheet that is added to the workbook.

[API 集: ExcelApi 1.7][ API set: ExcelApi 1.7 ]

worksheetId: string;

属性值

string

示例Examples

async function onWorksheetAdd(event) {
    await Excel.run(async (context) => {
        console.log(
            "Handler for worksheet onAdded event has been triggered. Newly added worksheet Id : " +
            event.worksheetId
        );
    });
}