schoong
Feb 05, 2026Copper Contributor
Status:
New
Ability to save settings in Excel workbook without clearing Undo stack
Both the Office API `Office.context.document.settings.saveAsync()` and the Excel API `context.workbook.settings.add(key, value)` clear the undo stack when called.
- Undo is very important for editing data in Excel
- The Excel JS API documentation says that https://learn.microsoft.com/en-us/office/dev/add-ins/excel/excel-add-ins-undo-capabilities#unsupported-apis, but we have to tell our users that this is not true because the settings in the workbook cannot be saved without clearing undo.
One of the following needs to happen:
- When `Office.context.document.settings.saveAsync()` is called, undo should not be disabled
- Or the newer Excel JS API's `context.workbook.settings.add()` should not disable undo
- 3. Or provide a `workbook.onSave` event, so that we can call settings.saveAsync() only when the workbook is saved. That may somewhat mitigate the damage by reducing the number of times that Undo. In our current implementation, it is constantly clearing the Undo stack, so putting it in a workbook `onSave` event would actually help a little with or without AutoSave on.
No CommentsBe the first to comment