To create a custom menu item in Excel

Source: Internet
Author: User
Walkthrough: Creating a custom menu item in Excel

Brian A. Randell.
MCW Technologies, LLC
September 2003
Applies To:
microsoft® Visual studio® Tools for the Microsoft Office System
Microsoft Office Excel 2003
Microsoft Visual Studio. NET 2003
Overview: Office CommandBar objects provide a way to add menu items and toolbar button codes. In this walkthrough, you will create a menu bar under the custom menu item and add code to respond to the Office menu.
Content:
Introduced
Creating menus and toolbar items is a central feature of Microsoft Office, although the experiment is a demonstration of using these items in Microsoft Office Excel 2003, but these actions are similar in Office Word. (The difference is that in Word the menu name is bar, and in Excel it's called Worksheet menu bar.) You will create a menu item in the Excel main menu. Then, you add this menu item. Finally, you add the Click event code to execute the custom code.
Tip: The object module for Office menus and toolbars is defined in Office.dll, when you set up a new visual Studio tools for Microsoft Office System project, Microsoft Visual studio®. NET automatically contains references to this module.
Prerequisite
To complete this walkthrough, the following software and components must be installed:
& #8226; Microsoft Visual Studio. NET 2003 or Microsoft Visual basic®. NET Standard 2003
& #8226; Microsoft Visual Studio Tools for the Microsoft Office System
& #8226; Microsoft Office Professional Edition 2003
Hint: If you are visual Basic. NET programmer, you need to set Option Strict to On (or you add Option Strict declarations in each module). Although this is not necessary, this ensures that you do not perform unsafe type conversions. In the future, the benefits of taking advantage of this option will be much greater than the difficulty of adding code.
Begin
You will build a new visual Studio. NET Excel project to begin with.
Establish a project

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.