In the realm of Excel Add-ins, I am currently developing a project using Angular and TypeScript. The primary objective is to establish a connection between values within the add-in and the spreadsheet, ensuring that users have access to information on which worksheet or cell they have linked the value to.
However, an issue arises when users decide to insert or remove a column (or row), causing the recorded cell reference in the add-in to become outdated and necessitating an update to reflect the new position correctly.
For instance, suppose a user associates a value with cell A1. Initially, this reference (A1) will be visible for that specific value within the add-in. If the user then adds a column at position A, the value previously situated in cell A1 will now reside in B1. Despite this change, the add-in would continue displaying cell A1 as the reference.
One potential solution I am exploring involves utilizing the event Office.EventType.DocumentSelectionChanged to monitor document modifications. However, a challenge lies in determining which part of the worksheet has been altered since the handler does not specify these details. Consequently, it becomes impractical to check every single cell for changes without significantly impacting the overall performance of the add-in.
With these considerations in mind, I welcome any suggestions you may have regarding this matter.