I’m working on an Excel add-in and need to register an event whenever the sheet is switch in a Workbook object.
I saw that the method onNameChanged was given to us. However, it only works when the sheet name of that current sheet is change (renaming the sheet) and not when switching between sheet. I think the reason being that it only support at the Worksheet object and not Workbook.
My current workaround right now is to register an onSelectionChanged event at the workbook level. (context.workbook.onSelectionChanged.add(function foo()).
However, this method wouldn’t be ideal because this event get call every time a selection is made. For example: selecting any cell in the current sheet causes a event trigger.
Could Microsoft Developer suggest such approach that event trigger when the sheet is switch? Would be great if you guys can create a new event supporting this!
Thank you!