none
Context help in userform RRS feed

  • Question

  • Hi,

    I do not manage to get it working.

    Having a userform with several labels and the WhatsThisHelp button = true.

    The mouse pointer, whenb clicking WTH is changing to arrow+question mark but the help is not showing up or with the wrong index. Right clinking the label gives Me.MousePointer=0, a left click does not trigger the sub. Any idea?

    Private Sub lblMedianVal_MouseDown(ByVal Button As Integer, ByVal Shift As Integer, ByVal x As Single, ByVal Y As Single)
       Debug.Print Me.MousePointer, Button, Shift, x, Y
        If Me.MousePointer = fmMousePointerHelp Then
            DisplayHTMLHelpTopic ThisWorkbook.Path & "\" & JPE_HLP_FILE, JPE_HLP_STATISTICS
            Me.MousePointer = fmMousePointerDefault
        End If
    End Sub

    Thursday, April 28, 2016 2:42 PM

Answers

  • Just a heads-up but be aware winhelp.exe, which runs the .hlp files, has not been included as standard since Vista and requires a separate download. 

    Look into using the HTML help API, start here

    https://msdn.microsoft.com/en-us/library/windows/desktop/ms670169(v=vs.85).aspx

    It's quite involved to integrate correctly with Excel but keep searching and you'll find examples. It's also a learning curve write .chm files, but if all done correctly can configure show the relevant page if say F1 is pressed on a given control in focus. Can also be implemented with UDFs and called in the function wizard.

    • Proposed as answer by David_JunFeng Wednesday, May 4, 2016 8:33 AM
    • Marked as answer by JP Ronse Wednesday, May 4, 2016 4:20 PM
    Tuesday, May 3, 2016 7:53 PM
    Moderator

All replies

  • Hi JP Ronse,

    Please tell me what's the meaning of lblMedianVal.

    Then as your problem is related to code in Excel, I'll move your question to the MSDN forum for Excel Developers:

    https://social.msdn.microsoft.com/Forums/en-US/home?forum=exceldev

    The reason why we recommend posting appropriately is you will get the most qualified pool of respondents, and other partners who read the forums regularly can either share their knowledge or learn from your interaction with us. Thank you for your understanding.


    Regards,

    Emi Zhang
    TechNet Community Support


    Please mark the reply as an answer if you find it is helpful.

    If you have feedback for TechNet Support, contact tnmff@microsoft.com.

    Friday, April 29, 2016 7:17 AM
  • Hi Emi Zhang,

    lblMedianVal is just a label on a userform.

    Clicking the WhatsThisHelp button changes the cursor to the arrow + question mark, left clicking the label opens the help file but on the wrong page. Right clicking on the label does nothing.

    The topic JPE_HLP_STATISTICS is correctly defined.

    Code after the help button:

    Private Sub cmdHelp_Click()
       DisplayHTMLHelpTopic ThisWorkbook.Path & JPE_HLP_FILE, JPE_HLP_STATISTICS
    End Sub

    does it correctly.

    Friday, April 29, 2016 10:30 AM
  • Hi, JP Ronse

    According to your description, please correct me if I have any misunderstandings on your question. You could call Application.Help method with name of your custom .Hlp file and topic ID.

    For more information, click here to refer about Application.Help Method (Excel)
    • Proposed as answer by David_JunFeng Wednesday, May 4, 2016 8:33 AM
    Monday, May 2, 2016 6:32 AM
  • Hi David,

    I'll give it a try one of the coming days. Keep you informed!

    Monday, May 2, 2016 6:20 PM
  • Just a heads-up but be aware winhelp.exe, which runs the .hlp files, has not been included as standard since Vista and requires a separate download. 

    Look into using the HTML help API, start here

    https://msdn.microsoft.com/en-us/library/windows/desktop/ms670169(v=vs.85).aspx

    It's quite involved to integrate correctly with Excel but keep searching and you'll find examples. It's also a learning curve write .chm files, but if all done correctly can configure show the relevant page if say F1 is pressed on a given control in focus. Can also be implemented with UDFs and called in the function wizard.

    • Proposed as answer by David_JunFeng Wednesday, May 4, 2016 8:33 AM
    • Marked as answer by JP Ronse Wednesday, May 4, 2016 4:20 PM
    Tuesday, May 3, 2016 7:53 PM
    Moderator
  • Hi Peter,

    My HTML help file is correctly integrated in Excel, I found out how Rob Bovey did in Excel Utilities. 

    I'm using the freeware Helpmaker and it is indeed a bit of a learning curve but I'm always keep on trying till I get the desired result, e.g. I can call the help on the UDF's (with the help of John Walkenbach). Now, reviewing my code and what I had in mind bring me to the conclusion that I was wrong in what I tried to achieve.

    Thanks for pointing out the correct way.

    Wednesday, May 4, 2016 4:37 PM