C#, VB.NET Excel add-in example

Add-in Express Toys™ .NET
for Microsoft Excel


Add-in Express Toys .NET is a free plug-in with source code (VB.NET, C#, C++) that adds several useful features to Microsoft Excel. This addin example is developed with Add-in Express for Office and .NET and shows how to create Excel add-ins, add custom ribbons and toolbars, and how to access Excel objects. Add-in Express for Office and .net supports all versions Microsoft Excel, from 2000 through 2021/365.

Add-in Express is a .NET object library specially designed to make the development of Excel COM add-ins as fast and comfortable as it can possibly be. It supports Visual Studio 2022 - 2012 including Visual Studio Express (VB.NET, C#).

Excel addin development made easy

  • Develop powerful plug-ins for Microsoft Excel 2021 - 2000.
  • Create your own toolbars, add command bar controls, handle Excel events and "hook" any built-in command bar controls.
  • Customize MS Office Ribbon UI, build the Quick Access Toolbar and the Office Menu.
  • More about Office Ribbon customization.
  • Create new custom worksheet functions using the Excel Automation Addin technology and XLL add-ins.
  • Build advanced task panes for Excel 2021 - 2000. More about custom Excel task panes.
  • Program Excel Real-Time Data servers that allow you to refresh any data on a worksheet in real-time, and more.

Add-in Express for Microsoft Office and .net provides the Excel.Application object as an entry point to all Excel objects and their events. The toolkit supports all popular programming languages of the .NET platform: Visual Basic (VB.NET), Managed C++ and C#.

Download .NET Excel add-in examples

Note. Compiled binaries are not included in the packages of Add-in Express Toys containing the source code. You need Add-in Express for Office and .NET to compile this sample Excel add-in.

Custom Excel ribbon and toolbar

Add-in Express Toys .NET plugin adds a custom ribbon tab to Excel 2021 - 2007:

Custom ribbon tab in Excel 2013

It also adds a new toolbar with several buttons to Excel 2003 and 2000:

Custom toolbar in Excel 2003

The buttons are:

A custom button that opens the About window

Custom button that opens the About window.

Custom button that enables / disables wrap text

Button that enables / disables "wrap text" for selected cells.

Excel custom button that enables / disables shrink to fit

Custom button that enables / disables "shrink to fit" for selected cells.

This custom drop-down menu applies the selected underline style

Custom drop-down menu that applies the selected underline style for selected cells.

Custom button that aligns text to the top of the cell

Aligns text to the top of cells.

Custom button that aligns text to the center of the cell

Aligns text to the center of cells.

Aligns text to the bottom of cells

Aligns text to the bottom of cells.

A custom Excel button that merges selected cells

Merges selected cells top-down and column-by-column.

This button merges selected cells and aligns text to the top of the merged cells.

Merges selected cells and aligns text to the top of the merged cells.

Another button that merges selected cells and centers the text

Merges the selected cells and aligns text vertically to the center of the merged cells.

The third button that merges selected cells and aligns text to the bottom

Merges the selected cells and aligns text vertically to the bottom of the merged cells.

Custom Excel menu item that shows / hides comments

Custom Excel menu that shows / hides comments, zero values, formulas, gridlines and page breaks.

A custom Paste Special dialog box

Custom Excel drop-down menu that replaces the built-in Paste Special dialog box.

  • All - pastes both the contents and formatting of the copied cells.
  • All except borders - pastes the contents and formatting of the cells except borders.
  • Paste links - links the pasted data to the active worksheet.
  • Formulas - pastes only formulas.
  • Values - pastes only values.
  • Formats - pastes only formatting.
  • Comments - pastes only the comments of the copied cells.
  • Column Widths - pastes the width of the copied columns.
  • Data Validation - pastes only the data validation rules.

Custom Excel buttons to paste special operations

Custom Excel buttons to paste special operations: None, Add, Subtract, Multiply, and Divide.

Custom Excel button for the paste option

Special paste option that does not replace values with the content of empty cells.

Custom Excel button for another paste option

Special paste option that transposes the copied columns to rows, and vice versa.

How to create Excel add-in: C#, VB.NET example: