'Check for Existing Event Handlers on Worksheet - Office JS - Excel
I'm trying to register event handlers for worksheets in my add-in and it works, but each time they re-load the taskpane it's re-adding the handlers and they are firing multiple times.
How can I check if there is already an event handler registered for worksheet events like onActived? I've debated/tested a bit w/ local/session storage but thats not ideal and I'd prefer to actually check the worksheet.
Is there a way?
I'm working on Excel on Windows.
Update: This may be related to how I load taskpanes.
I have a single taskpane that is generic and then I load specific taskpanes into a Div element on the main/generic taskpane using $(document).ready(function () { $('#' + ParentElm).load(HTMLFileStr) });
I think I can live w/ sessionStorage as I'm literally trying to track a variable per session, it's appropriate, but I'd still prefer to check/know how to/if possible to check worksheet for events registered if I could vs using storage/flags.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
