How does Office develop EXCEL plug-ins through VSTO?

0 Preface

  VSTO (Visual Studio Tools for Office) is an alternative to VBA and a set of Visual Studio toolkits for creating custom Office applications. VSTO can extend Office applications (such as Word, Excel, PPT) with Visual Basic or Visual C#. This article summarizes and records Excel plug-in development through VSTO.

1. Tool preparation

  (1) Install Visual Studio
  Search for the "Visual Studio2022" installation package in Baidu and other browsers, and then install it.

  (2) Install VSTO
  Select the "Office/SharePoint Development" toolset in the Visual Studio Installer to install.
  insert image description here

2. EXCEL add-in creation and generation

  (1) New project
  insert image description here

  (2) Create a functional area
  insert image description here

  insert image description here

  (3) Add function button
  insert image description here

  (4) Realize the function code
  Double-click the button1 button and write the code:
  insert image description here

using System.Windows.Forms;
  
MessageBox.Show("Hello, ExcelAddIns.");

3. Add-in program generation and use

  insert image description here

References:
[1] _Gvision. Excel VSTO extension development using Visual Studio: instructions and basic operations; 2018-12-04 [accessed 2023-07-14].
[2] stone0823. VSTO series (01) - Excel VSTO Introduction to Development ; 2021-03-09 [accessed 2023-07-14].
[3] Xiaosi Xiang. Introduction to VSTO Development, C# Operation Excel Objects ; 2020-12-18 [accessed 2023-07-14].
[4] ] CVSTO. VSTO Journey Series (2): Create Excel Solutions ; 2020-02-08 [accessed 2023-07-14].
[5] flyhawk007blog. VSTO Excel Development (1): Customize excel menu ; 2008-04 -18 [accessed 2023-07-14].
[6] Savetime2020. VBA to VSTO (vb.net entry Visual Studio) ; 2020-08-28 [accessed 2023-07-14].

Guess you like

Origin blog.csdn.net/qq_40640910/article/details/131724961