Before you start Excel development, you need to put the shelves together. The most straightforward is the menu in Excel, and he shows the user intuitively what our plug-ins are capable of. After the menu comes out, we can implement the events and functions inside. There are two forms of Excel menu, one is Excel 2003 and the previous traditional menu style, one is Excel 2007 and after the Ribbon menu. This article first explains the creation of menus in Excel 2007, including the Visual Studio visual Design menu, the ribbonxml configuration of menus, and then how to create a custom menu in Excel 2003. Finally, we demonstrate how to use the Sharedaddin technology to combine the two, that is, to display the original menu style in version 2003 and to dynamically load the Ribbon menu in Version 2003 to achieve version compatibility.
An Excel ribbon menu and Ribbon XML file
To demonstrate the creation of a menu, we first create an VSTO program, as shown in VS to create an Excel add-in:
Next, add the item and add a ribbon menu:
Before creating a menu, you need to be clear about what modules our plug-ins have. In order to demonstrate how to create a menu and the function points behind it, our plug-in intends to do four functional points. The first is the financial module, including from some open financial APIs such as the Sina Financial API, Yahoo API to obtain real-time or historical market data; Map modules, including map display, address retrieval, thematic mapping, weather modules, getting weather, weather-guaranteed tables, system modules, including login, help, about modules, etc. Once you have identified the functional points, you are ready to start creating menus.
After adding the Ribbon menu, you can open the Toolbox and start designing it, as shown in the following figure. The functions and Design essentials of each menu item are described below.
Basic controls
Related articles:
On the development of Excel (1) Excel Development Overview: http://www.bianceng.cnhttp://www.bianceng.cn/Programming/net/201312/39219.htm
2.1 Tab Control