Jump to content
Microsoft Windows Bulletin Board

Recommended Posts

Posted

We discovered that invoking Office.ribbon.requestUpdate to set visibility to a contextual tab unnecessarily clears the Undo stack.

Please lift this limitation if possible. Our customers complained about this issue, which does not exist on the legacy COM-based product.

Consider the following ScriptLab snippet: Undo stack clearing upon `Office.ribbon.requestUpdate`

Steps to reproduce:

Part 1:

  • Create a workbook with two worksheets, Sheet1 and Sheet2
  • On Sheet1, enter "foo" in A1 and enter "bar" in A2.
  • Activate Sheet2
  • Press Undo
  • Validate that Excel switched back to Sheet1 and the "bar" value disappeared

Part 2:

  • Register the ScriptLab snippet above ("Run in this tab") and press the "Register ribbon and worksheet change listener" button in the side panel to invoke requestCreateControls and register the worksheet change listener.
  • On Sheet1, enter "foo" in A1 and enter "bar" in A2.
  • Activate Sheet2
  • Limitation: Undo is not available anymore

In this scenario, we performed a harmless operation that simply made a ribbon tab visible. The customers do not expect the Undo stack to be cleared in this scenario.

Note: the Undo stack gets cleared regardless if there is any effective change to the ribbon item visibility/enabled state. Simply calling the API seems to clear the stack.

View the full article

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...