Welcome toExcel.Tips.Net
Tips.Net Home
ExcelTips Home
Ask an Excel Question
Make a Comment
ExcelTips FAQ
ExcelTips Premium
Learn Access Now
Free Printable Forms
Beauty Tips
Car Tips
Cleaning Tips
College Tips
Cooking Tips
Excel2007 Tips
ExcelTips
Family Tips
Gardening Tips
Health Tips
Home Tips
Legal Tips
Money Tips
Organizing Tips
Pest Tips
Pet Tips
Wedding Tips
Word2007 Tips
WordTips
Advertise on the
ExcelTips Site
Adding a Little Animation to Your Life
Converting a Range of URLs to Hyperlinks
Making the Formula Bar Persistent
Mark is a high school teacher and he wants to disable Excel's Help system during student tests. He wonders if there is an easy way to do this.
The answer is yes, there is a relatively easy way. You could set up a couple of macros that disable and restore the most common ways of opening the Help system. The following macros, DisableHelp and EnableHelp, do that.
Sub DisableHelp()
EnableControl 984, False ' help
EnableControl 1004, False ' Office Assistant
Application.OnKey "{F1}", ""
End Sub
Sub EnableHelp()
EnableControl 984, True ' help
EnableControl 1004, True ' Office Assistant
Application.OnKey "{F1}"
End Sub
Sub EnableControl(Id As Integer, Enabled As Boolean)
Dim CB As CommandBar
Dim C As CommandBarControl
For Each CB In Application.CommandBars
Set C = CB.FindControl(Id:=Id, recursive:=True)
If Not C Is Nothing Then C.Enabled = Enabled
Next
End Sub
Both of the main macros call the EnableControl macro. This macro does the actual work of removing the Help options from the menus and toolbars. Note that the main macros also use the OnKey method to disable (or restore) the functioning of the F1 function key. To use these macros, you can call them from a suitable event procedure, such as those that automatically run when a workbook is opened and closed.
The macros will run just fine in all the modern versions of Excel, but they are particularly useful in versions prior to Excel 2007. In those versions the menus and toolbars are modified by the macros, but not so in Excel 2007. The Help button (small question mark within a circle) remains at the upper-right corner of the worksheet window and can still be clicked. Regardless of your version, the F1 key is disabled and enabled by the macros.
Even with a macro such as this at work, you need to realize that the Help system is not totally disabled. The Help files still reside on disk, and could be located via Windows and opened. (You don't even need Excel to open and view them.)
Typically the Excel Help files are stored in files that use the CHM file extension. Disabling the file can be as simple as locating the proper CHM help file on the disk and renaming it to something different.
For example, Excel may be installed on a certain machine in the directory "c:\program files\microsoft office\office11". The Help file for this installation of Excel can be found in "c:\program files\microsoft office\office11\1033". The main Excel file is XLMAIN11.CHM, but there may be other Help files (CHM extension) in the directory as well. All you need to do is to rename these files something such as XLMAIN11.XXX. Since the Help program cannot locate the file, it cannot display any help in Excel.
ExcelTips is your source for cost-effective Microsoft Excel training. This tip (3406) applies to Microsoft Excel versions: 97 2000 2002 2003 2007
Got the Time? Understanding the ins and outs of working with times and dates can be confusing. Remove the confusion--ExcelTips: Times and Dates is an invaluable resource for learning how best to work with times and dates.