Excel.WorksheetAddedEventArgs interface
Provides information about the worksheet that raised the added event.
source | Gets the source of the event. See |
type | Gets the type of the event. See |
worksheet |
Gets the ID of the worksheet that is added to the workbook. |
Gets the source of the event. See Excel.EventSource
for details.
TypeScript
source: Excel.EventSource | "Local" | "Remote";
Property Value
Excel.EventSource | "Local" | "Remote"
Remarks
Gets the type of the event. See Excel.EventType
for details.
TypeScript
type: "WorksheetAdded";
Property Value
"WorksheetAdded"
Remarks
Gets the ID of the worksheet that is added to the workbook.
TypeScript
worksheetId: string;
Property Value
string
Remarks
Examples
TypeScript
// Link to full sample: https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/excel/30-events/events-workbook-and-worksheet-collection.yaml
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
);
});
}
Collaborate with us on GitHub
The source for this content can be found on GitHub, where you can also create and review issues and pull requests. For more information, see our contributor guide.
Office Add-ins feedback
Office Add-ins is an open source project. Select a link to provide feedback: