O'Reilly logo

Programming Excel with VBA and .NET by Steve Saunders, Jeff Webb

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Document

Documentation has evolved over the last several years to the point where most Help is provided over the Internet. That makes updating content easier, allows feedback, and probably most importantly maintains contact with customers.

You can create HTML documentation for your application using Word, FrontPage, or another editing tool—I wind up using Notepad more than I’d expect. HTML documents can be posted to a web server or they can be copied to the user’s machine along with the application.

Then, you simply link items to help pages using hyperlinks on the worksheets or by using the Application.Help or Workbook.FollowHyperlink method in code:

Sub TestShowHelp(  )
    Dim result As VbMsgBoxResult
    result = MsgBox("An error occured. Click OK to show help.", _
      vbOKCancel, "Error")
    If result = vbOK Then
        ' Display Help in Help window.
        Application.Help ("http://excelworkshop.com/Help/error51.htm")
        ' Alternate approach: display Help in browser.
        'ThisWorkbook.FollowHyperlink _
        '  ("http://excelworkshop.com/Help/error51.htm")
    End If
End Sub

The Help method displays the page in Excel’s Help window. The FollowHyperlink method displays the page in the browser. Using the browser provides better navigation tools, but the Help window shares the screen with Excel a little better.

You can also add links to Help from menu items in Excel. To do so:

  1. Choose Tools → Customize → Commands and select the Window and Help category.

  2. Drag Contact Us from the Commands list to the Help menu as shown in ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required