Thanks for sharing the details, Joan!
Excel 2021 is a perpetual license product. Its Office-JS API level is fixed and does NOT receive monthly feature updates.
Excel for Microsoft 365 does receive continuous API updates.
Undo support in Office-JS requires newer APIs
Features like:
Workbook.addUndoAction()
atomic batching for undo
improved async operation handling were added after the Excel 2021 codebase shipped.
Therefore:
Excel 365 → supports undo in Office-JS
Excel 2021 → does not support the newer undo framework
Best regards,
Kimberly