Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

XL2000: How to Turn off Shortcut Menus


View products that this article applies to.

Summary

There are many shortcut menus that appear when you right-click an object in Microsoft Excel 2000. For example, if you right-click a worksheet tab, the a shortcut menu with the following commands appears:
Insert...
Delete
Rename
Move or Copy...
Select All Sheets
-----------------
View Code
This article lists all of the built-in shortcut menus in Microsoft Excel 2000 and provides a sample macro code for turning off a shortcut menu.

↑ Back to the top


More information

Microsoft provides programming examples for illustration only, without warranty either expressed or implied, including, but not limited to, the implied warranties of merchantability and/or fitness for a particular purpose. This article assumes that you are familiar with the programming language being demonstrated and the tools used to create and debug procedures. Microsoft support professionals can help explain the functionality of a particular procedure, but they will not modify these examples to provide added functionality or construct procedures to meet your specific needs.
If you have limited programming experience, you may want to contact a Microsoft Certified Partner or Microsoft Advisory Services. For more information, visit these Microsoft Web sites:

Microsoft Certified Partners - https://partner.microsoft.com/global/30000104

Microsoft Advisory Services - http://support.microsoft.com/gp/advisoryservice

For more information about the support options that are available and about how to contact Microsoft, visit the following Microsoft Web site:http://support.microsoft.com/default.aspx?scid=fh;EN-US;CNTACTMS The following table lists all of the built-in shortcut menus and the value of the Index property for each menu.
   Shortcut menu              Index property
   -----------------------------------------
   Query and Pivot            19
   Workbook tabs              20
   Cell                       21
   Column                     22
   Row                        23
   Cell                       24
   Column                     25
   Row                        26
   Ply                        27
   XLM Cell                   28
   Document                   29
   Desktop                    30
   Nondefault Drag and Drop   31
   AutoFill                   32
   Button                     33
   Dialog                     34
   Series                     35
   Plot Area                  36
   Floor and Walls            37
   Trendline                  38
   Chart                      39
   Formula Bar                40
   PivotTable Context Menu    41
   Query                      42
   Query Layout               43
   AutoCalculate              44
   Object/Plot                45
   Title Bar (Charting)       46
   Layout                     47
   Shapes                     70
   Inactive Chart             71
   Excel Control              72
   Curve                      73
   Curve Node                 74
   Curve Segment              75
   Pictures Context Menu      76
   OLE Object                 77
   ActiveX Control            78
   WordArt Context Menu       79
   Rotate Mode                80
   Connector                  81
   &Wizard                    82
   Built-in Menus             83
   System                     84
				
NOTE: The list may vary beyond property index #81, based on additional add-ins that are installed and custom menus that exist.

If you want a macro to turn off shortcut menus in Microsoft Excel, you can use the CommandBars method. For example:
Sub DisableShortcutMenu()
   CommandBars("Cell").Enabled = False
End Sub
				
To turn on a shortcut menu once you have turned it off, set its Enabled property to True:
Sub EnableShortcutMenu()
   CommandBars("Cell").Enabled = True
End Sub
				
The following macro turns off the shortcut menu for worksheet tabs:
Sub Disable_Shortcut()
   CommandBars("ply").Enabled = False
End Sub
				
To turn on the shortcut menu for worksheet tabs again, set its Enabled property to True:
Sub Disable_Shortcut()
   CommandBars("ply").Enabled = True
End Sub
				

↑ Back to the top


References

For more information about CommandBars, in the Visual Basic Editor, click Microsoft Visual Basic Help on the Help menu, type commandbars property in the Office Assistant or the Answer Wizard, and then click Search to view the topic.

↑ Back to the top


Keywords: KB213757, kbprogramming, kbhowto, kbdtacode

↑ Back to the top

Article Info
Article ID : 213757
Revision : 8
Created on : 11/23/2006
Published on : 11/23/2006
Exists online : False
Views : 296