Consulting

Results 1 to 7 of 7

Thread: Ribbon disappearing bug / issue with getVisible and .Invalidate

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1

    Ribbon disappearing bug / issue with getVisible and .Invalidate

    Hi,

    I have a custom toolbar in excel and in it I have a toggleButton. I want the state of this button to be context sensitive depending on the formatting of the selected cell(s).
    To achieve this I have a custom class module that invalidates the ribbon every time there is a selection change. This forces a refresh of the getPressed attribute of the button which runs some logic to determine what state it should be in.

    This all works fine, however I also have a getVisible tag for the entire ribbon tab which I am using as a sort of basic DRM. It checks against the username format of the company and disables the ribbon if it doesn't match.

    Now the bug I am experiencing is, if I select a cell contents by either pressing "F2" or double clicking the mouse, occasionally (but not always) the entire ribbon disappears. When the worksheet selection is changed again, the .Invalidate fires and the ribbon reappears.

    I know that if I remove the getVisible tag from the ribbon xml, I do not have this issue, so I believe it is something to do with that. Unfortunately as far as I can tell from testing it in isolation, the code always returns "enabled = True".

    As it's quite a complicated set of subs to explain, I have attached an example - does anyone have any ideas as to what is going on here?

    Example.xlsm

    EDIT: After further testing it seems to happen only with a particularly quick switch into a cell's contents occurs after a change of selection i.e
    Select a cell and hit F2 to enter it
    Hit return, immediately followed by F2 again (ribbon disappears)
    Hit return again or use mouse and the ribbon will return
    Last edited by rdekanter; 10-17-2018 at 04:40 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •