Skip to main content

Err object HelpFile property

Table of contents
  1. Remarks
  2. Examples

Returns or sets a string expression with the fully qualified path to a Help file. Read/write.

Remarks

If a Help file is specified in HelpFile, it is automatically called when the user presses the Help button (or the F1 KEY in Windows or the HELP key on the Macintosh) in the error message dialog box. If the HelpContext property contains a valid context ID for the specified file, that topic is automatically displayed. If no HelpFile is specified, the Visual Basic Help file is displayed.

Examples

This example uses the HelpFile property of the Err object to start the Help system. By default, the HelpFile property contains the name of the Visual Basic Help file.

Dim Msg
Err.Clear
On Error Resume Next    ' Suppress errors for demonstration purposes.
Err.Raise 6    ' Generate "Overflow" error.
Msg = "Press F1 or HELP to see " & Err.HelpFile & _
" topic for this error"
MsgBox Msg, , "Error: " & Err.Description, Err.HelpFile

Leave a comment

Your email address will not be published. Required fields are marked *

Format your code: <pre><code class="language-vba">place your code here</code></pre>