Mathias Brandewinder on .NET, F#, VSTO and Excel development, and quantitative analysis / machine learning.
by Mathias 1. April 2010 08:08

My step-by-step Excel 2007 VSTO add-in tutorial has been growing quite a bit, and Dennis Wallentin, in his great wisdom, suggested that a table of contents would be a useful addition. Here it is – I will update this page as I keep adding to the tutorial.

Part 1: displaying worksheets in a TreeView within a Custom Task Pane

This first part focuses on using a WPF TreeView hosted in a Custom Task Pane to display all the workbooks and worksheets that are currently open, and refreshing the contents based on the events exposed by Excel.

1. Getting Started
2. Using the Custom Task Pane
3. Using the Ribbon
4. Adding a WPF control
5. Displaying open workbooks & worksheets in a TreeView
6. Using Excel events to update the TreeView
7. Wrapping up part 1

Code sample for part 1

Part 2: finding differences between worksheets

This second part focuses on reading the contents of worksheets to identify their differences, and on building a WPF user interface in the Task Pane, using the MVVM pattern, to navigate between the differences and highlight them. 

8. Binding to Commands to navigate to Cells
9. Reading the values and formulas from worksheets
10. Use a WPF converter to display differences

Code sample for part 2

Part 3: deployment

11. Creating a basic msi installer

To be continued...

Comments

4/1/2010 10:34:57 PM #

Dennis Wallentin

Mathias,

Good - I have added a link to this page.

Kind regards,
Dennis

Dennis Wallentin Sweden | Reply

4/4/2010 9:43:39 PM #

Patrick O'Beirne

Just a reminder for VBA developers wanting to put a toe in the water, it's an extra cost:

Quote:
"In order to write our Excel 2007 VSTO add-in, we need:
•Visual Studio 2008 Professional Edition. Unfortunately, Visual Studio 2008 Express, the free edition of VS, does not support Office Automation."

Patrick O'Beirne Ireland | Reply

4/5/2010 3:44:49 AM #

mathias

@Patrick: you are absolutely right, and I must say I don't understand Microsoft on this. Visual Studio Express is totally free and you can use it to write fully functional .Net applications, so why not include VSTO as well? In my opinion, this would really help adoption among VBA developers - as you point out, Visual Studio is an expensive entrance ticket for someone who just want to try out...

mathias United States | Reply

4/5/2010 3:47:21 AM #

Dennis Wallentin

Patrick,

I actually discussed it in the comments to the following URL at my blog:
xldennis.wordpress.com/.../

In my opinion, it's the largest hinder for a more widely use of VSTO.

Kind regards,
Dennis

Dennis Wallentin Sweden | Reply

4/14/2010 12:02:21 PM #

trackback

Create an Excel 2007 VSTO add-in: go to cell

Create an Excel 2007 VSTO add-in: go to cell

Clear Lines Blog | Reply

5/29/2010 12:01:27 PM #

trackback

Excel 2007 VSTO add-in tutorial

You've been kicked (a good thing) - Trackback from DotNetKicks.com

DotNetKicks.com | Reply

5/29/2010 9:23:54 PM #

trackback

Excel 2007 VSTO add-in tutorial

Thank you for submitting this cool story - Trackback from DotNetShoutout

DotNetShoutout | Reply

6/27/2010 9:22:28 PM #

Nanda

Cool. Thanks for this post.

Nanda India | Reply

7/26/2010 11:54:08 PM #

Bryan

I am curious about applying patterns such as CAB to VSTO.  I've been unable to find any example of this on the internet and am curious if you have any suggestions in regard to this?  I too often write an application and realize when I have completed a large portion of it that I should have applied some type of guidance package.  

Bryan United States | Reply

7/31/2010 1:07:00 PM #

Mathias

Hi Bryan,
It's an interesting question. A framework like the CAB seems like overkill for a VSTO application, because they tend to remain rather small in size. On the other hand, some common issues appear regularly in add-ins. I usually end up including the MVVM Foundation classes from Josh Smith for the WPF aspect, and logging is also a common one. A while back, I had begun putting together a "mini framework" to handle menus in Office 2003 add-ins. I haven't looked at it in ages because I mostly work with 2007 now, but maybe something similar would be useful for 2007, to tie in the Ribbon and Custom Task Panes for instance. Maybe a good project template would work better than a framework.
Are you coming at this question because you have issues with structuring VSTO projects (maybe getting large?), or is it more about avoiding re-inventing the wheel and re-writing the same code in each project? I would be very interested in hearing more!

Mathias United States | Reply

9/26/2010 6:40:21 PM #

Sandeep

Hello,

I would like to know, what would I compromise. if I try the same thing using VS2008..
Pls help me

Thanks
Sandeep

Sandeep United Kingdom | Reply

1/8/2011 6:57:49 AM #

trackback

Create an Excel 2007 VSTO add-in: read worksheets

Create an Excel 2007 VSTO add-in: read worksheets

Clear Lines Blog | Reply

1/10/2011 3:03:13 AM #

victor

cool introduction to the topic. eases you into the world of VSTO.

victor United Kingdom | Reply

Add comment




  Country flag

biuquote
  • Comment
  • Preview
Loading



Comments

Comment RSS