Given the below code snippet, I'd expect to get a single console log the first time A1 is updated. Instead I get one every time A1 is updated, indicating that the binding isn't actually being deleted.
Excel.run(async (context) => {
const address = 'A1';
const bindindId = `myPrefix.${address}`;
const binding = context.workbook.bindings.add(address, Excel.BindingType.range, bindindId);
binding.onDataChanged.add(async (args) => {
console.log('binding onDataChanged', address);
args.binding.delete();
});
});
I also found https://stackoverflow.com/questions/58867679/excel-binding-class-delete-method-not-actually-deleting-the-binding, however their workaround of making the binding id unique apparently no longer works.
The https://learn.microsoft.com/en-us/javascript/api/excel/excel.binding?view=excel-js-preview#excel-excel-binding-delete-member(1) (along with the method signature) indicates this should be working.
1 Comment
- mbrooks-columbiaCopper Contributor
I'm experiencing the same behavior, `.delete()` method of the Binding class does not actually delete the binding. It does not throw an error or indicate failure in any way. I've tried multiple ways with no success.
Deletion is a pretty fundamental capability, so I'm surprised this has been an outstanding issue since 2019.