an add in I'm developing is having issues with context.sync failing when a cell is in editing mode.
I would like to use delayForCellEdit in Excel.Run but it would cause the UI to hang until the user exits edit mode.
Is there a method to determine if Excel is in edit mode prior to calling context.sync?
My first inclination is to run
Excel.run(ctx => {
ctx.sync().then(() => {
console.log("not in edit mode);
}).catch(err => {
console.log("in edit mode");
});
});
as a heartbeat every few seconds, but would like something a bit more elegant.
Currently we only support
delayForCellEdit
to delay thecontext.sync()
until exit edit mode. And I tested locally didn't meet the hang issue as you mentioned.Here is my sample code for test and just for your reference:
$("#run").click(() => tryCatch(run));