Consulting

Results 1 to 2 of 2

Thread: InvalidateControl in Excel not working... not sure what I'm doing wrong

  1. #1
    VBAX Newbie
    Joined
    Feb 2023
    Posts
    1
    Location

    InvalidateControl in Excel not working... not sure what I'm doing wrong

    Thank you for taking the time to read my question.
    I have an EditBox in my ribbon that I want to clear after a button is clicked (also in the ribbon).
    I have this at the top of my module:
    Dim MyRibbon As IRibbonUI
    Sub MyAddInInitialize(Ribbon As IRibbonUI)
    Set MyRibbon = Ribbon
    End Sub
    And this is the code that I'm having issues with. When I click my button and call Sub CommandButton16 (or 17) I want the last thing it does to be clearing 2 EditBoxes. So far just trying to clear the one.... but I'm getting the error shown in the screen.
    What am I doing wrong?

    ClearEditBoxes.jpg

    TheXML.jpg


    Above is the XML from Office RibbonX Editor pertaining to my buttons that do stuff, then I want them to clear the editBoxes after.
    Thanks!
    Last edited by Aussiebear; 02-11-2023 at 05:35 PM. Reason: Added code tags to supplied code

  2. #2
    MyRibbon should be declared as Public or Global:

    Global MyRibbon As RibbonUI

    Using Dim makes it Private (only visible within the Module it was created).

Tags for this Thread

Posting Permissions

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