Skip to content
This repository has been archived by the owner on Jun 12, 2019. It is now read-only.

Event Listeners for when defined name is created or modified [Excel] [Feature Request] #1507

Closed
achang0406 opened this issue Oct 12, 2018 · 2 comments

Comments

@achang0406
Copy link

Similar to issue #1503

Issue 1

There are no event listener when a new defined name is created inside excel.

workaround

Our current proposed workaround is similar to the conditional formatting workaround where we check Excel. NamedItemCollection.getCount every 5 seconds to check whether size is different. If it is different than this would mean that the user has created a new defined name (named range).

risk
poor performance, heaving client logic

Proposed Solution 1
Implement an onAdd event listener for Excel.NamedItemCollection to notify any new defined name being created. This would prevent our client having to periodically check for new define names.

This event listener should have at least the below data in the arguments:

  1. the created defined name
    a. worksheet name
    b. cell range

Issue 2

There are currently also no way to detect when an existing defined name is being edited (in the case of renaming a defined name or modifying the cell range).

workaround

  1. Client has to create an update button for the user to detect any new defined names.
  2. Every 5 seconds call Excel.NamedItemCollection.items to get the whole list of defined names and compare with the previous list of defined names to see any has changed.

risk
Poor performance, heavy client logic

proposed Solution 2
Implement an onChange event listener for Excel.NamedItemCollection to notify any new defined name being modified.

This event listener should have at least the below data in the arguments:

  1. the updated defined name
    a. updated worksheet name
    b. updated cell range
    c. the previous change (cell range, name of the defined name, etc)
@weshi
Copy link

weshi commented Oct 13, 2018

Added to our internal backlog and will do planning accordingly.

Product Backlog Item 2626621: [Customer Ask] Adding onChanged event for NamedItem/NamedItemCollection

Thank you for the feedback.

@kbrandl
Copy link
Contributor

kbrandl commented Jun 5, 2019

@achang0406 if you haven't already done so, can you please log this as a feature request in UserVoice? We'll be archiving this repository (OfficeDev/office-js-docs) soon.

@kbrandl kbrandl closed this as completed Jun 5, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants