Note
Access to this page requires authorization. You can try signing in or .
Access to this page requires authorization. You can try .
Excel.WorksheetAddedEventArgs interface
- Package:
- excel
Provides information about the worksheet that raised the added event.
Properties
| source | Gets the source of the event. See |
| type | Gets the type of the event. See |
| worksheetId | Gets the ID of the worksheet that is added to the workbook. |
Property Details
source
Gets the source of the event. See Excel.EventSource for details.
source: Excel.EventSource | "Local" | "Remote";
Property Value
Excel.EventSource | "Local" | "Remote"
Remarks
type
Gets the type of the event. See Excel.EventType for details.
type: "WorksheetAdded";
Property Value
"WorksheetAdded"
Remarks
worksheetId
Gets the ID of the worksheet that is added to the workbook.
worksheetId: string;
Property Value
string
Remarks
Examples
// 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
Was this page helpful?
