We have an Excel office js add-in written on angular. It has different functionalities based on the sheet the user is in. When users switch the sheets of excel, how can the
You can add handler for context.workbook.worksheets.onActivated
Excel.run((context) => {
context.workbook.worksheets.onActivated.add(({ worksheetId }) => {
console.log('Selected worksheet', worksheetId)
})
return context.sync()
.then(function () {
console.log("Event handler successfully registered");
});
}).catch(errorHandlerFunction);
More info here