Excel Development tour: excel tour
Development Environment: Microsoft Visual Studio 2015, Office 2013
Development language: C #
1. Create a project: Create a project in the file, and select the office ins Excel 2013 and 2016 VSTO ins,
Go to the ThisAddIn. cs file and we will find that two methods have been automatically generated:
ThisAddIn_Startup (): excel loads this method before calling the plug-in.
ThisAddIn_Shutdown (): called when excel is closed.
The specific usage will be detailed in the subsequent use process.
2. Select the project you just created, and right-click a to add a new item)
3. After adding the functional area designer, you can add some buttons and other tools from the Toolbox on the right. Three buttons are simply added.
4. Basically, a simple "Excel secondary development" project is created here. Click "Run (F5)" to start the project. As you can see, the function designer we just edited is loaded into excel.
Note: if an error occurs during the running process, the following error occurs during the next running:"Ask if we want to disable the plug-in we just wrote"Select"No"That's all.
If we accidentally select "yes", it doesn't matter. Open the Excel file, select "file à option à add-on", and find "manage". In the drop-down list, find the Disabled Project, select "go to (G)", select the disabled plug-in, and click "enable ". This is not complete yet. You also need to select "COM add-on" from the "manage" drop-down list, select the plug-in you just developed, and click "OK.
Now, let's share today. Continue!