Need help with HelpContextID

KentBurel

Board Regular
Joined
Mar 27, 2020
Messages
68
Office Version
  1. 2019
Platform
  1. Windows
I'm working to link my workbook to a .CHM file for my help system. I used the Microsoft HTML Help Workshop and the CHMProcessor tools I found on the web. They are not the best but I've made them work. I wrote my help file in Word and then compiled them to a .chm file. Then I put the .chm file in the same directory as my .xlsx file. Next I added code to the ThisWorkbook module that looks like this:
VBA Code:
Sub Workbook_open()
    Application.OnKey "{F1}", "GetHelp"
End Sub

Then I wrote a macro for the GetHelp associated with F1. It look like this:

VBA Code:
Option Explicit

Sub getHelp()
    Dim currentPath As String
    currentPath = ActiveWorkbook.Path
    Application.Help (currentPath & "\LogicAndAccuracyTesting.chm")
End Sub
This all works. Now wherever I am, I can hit Fn-F1 on my keyboard and I see my help file.

The Application.Help method also supports the HelpContextID property. I want to set F1 with the Sheet.Activate event to pass a HelpContextID when someone hits F1 so that I can guide them directly to the help topic for that sheet. How do I get the HelpContextID for a given topice in my .chm file so I can pass the right ID from Excel?
 

Excel Facts

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple
I've discovered that userforms and button have a HelpContextID property. The property type is long. So it will only accept a number. How do I create a reference in my help file that is acceptable as a HelpContextID?
 
Upvote 0

Forum statistics

Threads
1,215,651
Messages
6,126,027
Members
449,281
Latest member
redwine77

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top