XL98: How to Disable Shortcut Menus

ID: Q184895

The information in this article applies to:

SUMMARY

There are many shortcut menus in Microsoft Excel 98 Macintosh Edition that appear when you hold the CONTROL key and click an object. For example, if you hold the CONTROL key and 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 98 Macintosh Edition and provides a sample Visual Basic for Applications macro that disables a shortcut menu.

MORE INFORMATION

The following table lists all of the built-in shortcut menus and the Index property value for each menu.

   Shortcut menu                 Index property
   --------------------------------------------

   Query and Pivot                      18
   Shapes                               24
   Inactive Chart                       25
   Excel Control                        26
   Curve                                27
   Curve Node                           28
   Curve Segment                        29
   Pictures                             30
   OLE Object                           31
   ActiveX Control                      32
   WordArt                              33
   Rotate Mode                          34
   Connector                            35
   Workbook tabs                        36
   Cell                                 37
   Column                               38
   Row                                  39
   Cell                                 40
   Column                               41
   Row                                  42
   Ply                                  43
   XLM Cell                             44
   Document                             45
   Desktop                              46
   Nondefault Drag and Drop             47
   AutoFill                             48
   Button                               49
   Dialog                               50
   Series                               51
   Plot Area                            52
   Floor and Walls                      53
   Trendline                            54
   Chart                                55
   Formula Bar                          56
   PivotTable                           57
   Query                                58
   Query Layout                         59
   AutoCalculate                        60
   Object/Plot                          61
   Title Bar (Charting)                 62
   Layout                               63
   Built-in Menus                       83

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 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/

The following sample Visual Basic macro disables the shortcut menu for worksheet tabs:

   Sub Disable_Shortcut()
       CommandBars(43).Enabled = False
       ' You can also use the name of the shortcut menu like this
       ' line of code: CommandBars("ply").Enabled = False
   End Sub

NOTE: To enable the shortcut menu for worksheet tabs, modify the macro, change the value of the Enabled property 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."

NOTE: If the Assistant is hidden, click the Office Assistant button on the Standard toolbar. If the Assistant is not able to answer your query, please see the following article in the Microsoft Knowledge Base:

   ARTICLE-ID: Q176476
   TITLE     : OFF: Office Assistant Not Answering Visual Basic Questions

Additional query words: XL98
Keywords          : kbdta xlui xlvbahowto xlvbainfo 
Version           : MACINTOSH:98
Platform          : MACINTOSH
Issue type        : kbhowto

Last Reviewed: May 18, 1999