Excel 2007, 2010 addin example for VSTO
with VB.NET and C# source code

Add-in Express Toys™ VSTO
for Microsoft Excel

Add-in Express Toys VSTO is a free sample add-in that extends Microsoft Excel with some useful features. This addin is based on Add-in Express for Office and VSTO and gives you an example of developing Excel add-ins, creating custom toolbars and controls, and accessing Excel objects. Add-in Express for Office and VSTO supports Microsoft Excel 2003, 2007 and Excel 2010.

How to extend Excel in Visual Studio Tools for Office

Add-in Express for VSTO was specially designed to make the development of add-ins in VSTO as easy as it can be. It supports VS 2005 with Visual Studio Tools for Office Second Edition (SE) installed and Visual Studio 2008, 2010 (VB.NET, C#).

With Add-in Express for VSTO you can:

  • Build feature-rich add-ins for Microsoft Excel 2003, Excel 2007 and Excel 2010.
  • Create advanced task panes for Excel 2003 - 2010.
  • Develop custom Excel workbooks.
  • Intercept keyboard shortcuts.
  • Create custom toolbars, populate them with your controls, handle Excel events and any built-in command bar controls.
  • Customize Excel 2007, 2010 Ribbon UI, build the Quick Access Toolbar and the Office Menu for Microsoft Excel 2007.

The above is just a short list of examples of what you can do with Add-in Express for VSTO. Find more amazing features for enhancing the Excel UI.

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

Download sample Excel add-in

1. Compiled binaries are not included in the setup package of the Add-in Express Toys VSTO. You need Add-in Express for Office and VSTO to compile this Excel add-in.

2. All projects are created using Visual Studio 2005 with VSTO 2005 SE. When opened in the Visual Studio 2008, the projects will be automatically converted into the VS 2008 format.

Sample Excel add-in for VSTO toolbar

Add-in Express VSTO Toys adds to the Excel application a new toolbar or a ribbon tab (in Excel 2007) with several buttons:

Custom Excel ribbon toolbar

The custom buttons allow you to:

  • Enable / disable "wrap text" and "shrink to fit" for selected cells.
  • Apply a selected underline style for selected cells.
  • Align text vertically to the top, center or bottom of cells.
  • Merge selected cells top-down and column-by-column.
  • Merge selected cells and align text vertically to the top, center or bottom of the merged cells.
  • Show / hide comments, zero values, formulas, gridlines and page breaks.

The custom Excel toolbar gives your end-users a number of advanced paste options. The Paste Special drop-down menu replaces the built-in Excel paste and contains the following buttons:

Excel paste options

  1. All - pastes the content and formatting of copied cells.
  2. All except borders - pastes the cell content and formatting except for borders.
  3. Paste links - links the pasted data to the active worksheet.
  4. Formulas - pastes the formulas of copied cells.
  5. Values - pastes only values.
  6. Formats - pastes the cell formatting only.
  7. Comments - pastes the comments of copied cells.
  8. Column Widths - pastes the width of copied columns.
  9. Data Validation - pastes the data validation rules.
  • Allow special paste operations such as None, Add, Subtract, Multiply, and Divide, prevent replacing values in the paste area when blank cells occur in the copy area and change columns of copied data to rows, and vice versa.