The information in this article applies to:
SUMMARYYou can use the Microsoft Windows Dynamic Link Libraries (DLLs) to disable the commands in the Microsoft Excel Control menu. For example, you can use these tools to delete the Minimize and Maximize buttons. MORE INFORMATIONMicrosoft 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/overview/overview.aspMicrosoft Excel does not have the built-in functionality to modify the Control menu commands. However, you can use the Declare statement in a Visual Basic procedure to call Microsoft Windows functions to disable and restore Control menu items. The following example Visual Basic procedure, Disable_Control, disables the entire Control menu in Microsoft Excel. The macro disables the Control menu for the current session of Microsoft Excel (when you restart Microsoft Excel the Control menu will be reset). The procedure RestoreSystemMenu restores the Control menu. Microsoft Excel version 97 and 7.0
Microsoft Excel version 5.x
NotesThe commands on the control menu are numbered starting at zero. The default control menu items are as follows: Control Menu Restore is item 0, Move is item 1, Size is item 2, and so on. Even if items are deleted, the first item always starts at zero.To delete individual items from the control menu without deleting the entire menu, you can specify the menu command to delete. For example the following two lines of code when used in place of the For Next loop in the procedure Disable_Control above, will delete the Maximize (item 4) and Minimize (item 3) commands and disable the Maximize and Minimize buttons.
Additional query words: 5.00c 8.00 97 call register remove api
Keywords : kbprg kbdta KbVBA |
Last Reviewed: November 9, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |