VSTO examples for Excel - sample add-in project in VB.NET, C# with 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 2008 for VSTO and gives you an example of developing Excel add-ins, creating custom toolbars and controls, and accessing Excel objects. Add-in Express Toys VSTO supports Microsoft Excel 2003 and Excel 2007.
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 (VB.NET, C#).
Here are just a few examples of what you can do with Add-in Express 2008 for VSTO:
- Build feature-rich add-ins for Microsoft Excel 2003 and Excel 2007.
- Create advanced task panes for Excel 2003 and 2007.
- 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 Ribbon UI, build the Quick Access Toolbar and the Office Menu for Microsoft Excel 2007.
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
Please note, the compiled binaries are not included in the setup package of the Add-in Express Toys VSTO. You need Add-in Express 2008 for VSTO to compile this Excel add-in.
- Download sample Excel add-in in C# (source code)
- Download sample Excel add-in in VB .NET (source code)
- Download a compiled Excel add-in (ready to install and use)
Note! 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.
Add-in Express Toys VSTO toolbar
Add-in Express Toys VSTO for Excel adds to Excel a new toolbar or a ribbon tab with several buttons:

The custom buttons allow you to:
- Enable / disable "wrap text" and "shrink to fit" for the 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:

- All - pastes the content and formatting of copied cells.
- All except borders - pastes the cell content and formatting except for borders.
- Paste links - links the pasted data to the active worksheet.
- Formulas - pastes the formulas of copied cells.
- Values - pastes only values.
- Formats - pastes the cell formatting only.
- Comments - pastes the comments of copied cells.
- Column Widths - pastes the width of copied columns.
- 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.
Have a question? Ask it right now!
![]() |
If you need quick assistance or want to share your concerns, ideas or suggestions, please write us using the form below. |
![]() |



