+ Reply to Thread
Results 1 to 7 of 7

How to get User Form Controltiptext to appear without selecting the user form?

  1. #1
    Forum Contributor
    Join Date
    10-10-2018
    Location
    Calgary, Canada
    MS-Off Ver
    2016
    Posts
    214

    How to get User Form Controltiptext to appear without selecting the user form?

    I have a userform permanently at the top of my workbook. This functions as my custom menu, and covers all the Excel ribbon and menus.

    The problem is that Excel does not "select" this user form and the worksheet organically. Either the userform is "selected" by clicking a blank space in the userform, or the worksheet is selected by clicking a cell in the worksheet. The "selection" does not occur oganically simply by mousing over the userform and worksheet areas.

    The problem is that the controltiptext of my userform buttons do not appear, unless the userform is selected. So I have to move the mouse over the userform, click a blank space and then the controltiptext appears.

    Similarly the Notes on the worksheet do not appear if the userform is selected, I have to click on an empty cell and then the worksheet is selected and the notes appear.

    Can I use the MouseMove event on the userform to select the userform and activate the worksheet organically? Thanks!

  2. #2
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,434

    Re: How to get User Form Controltiptext to appear without selecting the user form?

    What's special about the contents of the userform that you have used that approach rather than customising the ribbon?

    Your approach is always going to struggle trying to determine whether the user should be shown info from the worksheet or userform because as you say only one can have focus at a time. There is no easy way to tell a user has finished with the userform and needs to see info from the worksheet or vice versa.
    Cheers
    Andy
    www.andypope.info

  3. #3
    Forum Contributor
    Join Date
    10-10-2018
    Location
    Calgary, Canada
    MS-Off Ver
    2016
    Posts
    214

    Re: How to get User Form Controltiptext to appear without selecting the user form?

    Because customizing the ribbon exposes the fact that the app is an Excel file, whereas I want to completely transform it into a standalone app. For the most part I've achieved it except for things like the focus issue.

  4. #4
    Forum Contributor
    Join Date
    10-10-2018
    Location
    Calgary, Canada
    MS-Off Ver
    2016
    Posts
    214

    Re: How to get User Form Controltiptext to appear without selecting the user form?

    Quote Originally Posted by Andy Pope View Post
    There is no easy way to tell a user has finished with the userform and needs to see info from the worksheet or vice versa.
    Hi Andy, I don't understand "there is no easy way". Isn't the easy way to use the MouseMove event of the userform? I created a label that shows the coordinates of the mouse that is triggered by the Userform_MouseMove event, to see if it is working when the worksheet has the focus, and the label is showing the mouse coordinates when the mouse is over the userform. So I would think there is a way to get the controltiptext to appear when you mousemove over the userform? But what action should I trigger? the only thing I do to get the controltiptext to appear is to click on the userform - is there a "click userform" command, or setfocus on userform?

    Then to set focus back to the worksheet, I guess I could create a label that spans the bottom of the userform, and when the mouse crosses the label, some command would be triggered (WS.Activate ?) to put the focus back to the worksheet.

    Would that work?

  5. #5
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,434

    Re: How to get User Form Controltiptext to appear without selecting the user form?

    The mouse move stops when not over the userform. So what would you use to capture that, as there is no mouse movement event off of the userform?
    Also you would need to either place a control over the whole of the userform to capture movement or capture it in every control. And to capture the mouse movement near the edge of the userform you would need to have a lot of space around the edges. Even then it is possible with a rapid mouse movement to not raise the event in enough time to refocus to the worksheet.

    You know you can remove all of the standard ribbon and just have your one. Surely your user knows it's excel they are using as the either have to start Excel or open a workbook.

  6. #6
    Forum Contributor
    Join Date
    10-10-2018
    Location
    Calgary, Canada
    MS-Off Ver
    2016
    Posts
    214

    Re: How to get User Form Controltiptext to appear without selecting the user form?

    The problem with using Custom Ribbons, is that they can't be edited in run-time. I have code that modifies the menu depending on which worksheet is open and the user credentials (I have an encrypted user management system). As far as I know XML code that governs ribbons is static?

    Thanks
    Last edited by superlative; 12-24-2019 at 07:18 PM.

  7. #7
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,434

    Re: How to get User Form Controltiptext to appear without selecting the user form?

    You can use callbacks to update the ribbon using VBA whilst the application is being used.

    https://docs.microsoft.com/en-us/ope...6-3f63365043c7

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. VBA code to open a user form if the user form is located in an addin?
    By bresman in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-19-2019, 09:04 AM
  2. Upload inputs from a User Form repeatedly until the user clicks the red X on the Form
    By TheJimmyMcGill in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-25-2019, 05:46 PM
  3. Populate text boxes on user form, from combo box on same user form
    By Richardswaim in forum Excel Programming / VBA / Macros
    Replies: 26
    Last Post: 07-03-2016, 09:35 AM
  4. [SOLVED] User Form to execute search and return all values to the user form for editing
    By allwrighty in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-11-2013, 10:40 PM
  5. [SOLVED] Excel vba user form- open directly to user form not worksheet
    By PANTECH in forum Excel Programming / VBA / Macros
    Replies: 26
    Last Post: 04-24-2013, 05:07 PM
  6. [SOLVED] Excel user form- If/Then statement outcome to show on user form
    By PANTECH in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-18-2013, 09:16 AM

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1