XL97: How to Disable Shortcut Menus

Last reviewed: February 27, 1998
Article ID: Q161440
The information in this article applies to:
  • Microsoft Excel 97 for Windows

SUMMARY

There are many Shortcut menus in Microsoft Excel that appear when you right-click an object. For example, if you right-click a worksheet tab, the following shortcut menu 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 97 and provides a sample macro code for disabling a shortcut menu.

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 engineers 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 the Microsoft fee-based consulting line at (800) 936-5200. For more information about the support options available from Microsoft, please see the following page on the World Wide Web:

   http://www.microsoft.com/support/supportnet/refguide/default.asp

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

The following macro disables the shortcut menu for worksheet tabs:

   Sub Disable_Shortcut()
       CommandBars(27).Enabled = False
       ' You can also use the name of the shortcut menu as in the following
       ' line of code: CommandBars("ply").Enabled = False
   End Sub

NOTE: To re-enable the shortcut menu for worksheet tabs, change the Enabled property in the above macro to True, and then rerun the macro.

REFERENCES

For more information about Command Bars, click the Office Assistant while in the Visual Basic Editor, type "commandbars", click Search, and then click to view "Using command bars".


Additional query words: 97 8.00 XL97
Keywords : kbcode kbprg kbualink97 xlvbahowto xlvbainfo xlui
Version : WINDOWS:97
Platform : WINDOWS
Issue type : kbinfo


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: February 27, 1998
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.