1. Home
  2. Computing & Technology
  3. Visual Basic

Chapter 13 - Microsoft Office Applications and Managing Processes - Part 1

By Dan Mabbutt, About.com

6 of 9

Introducing the VSTO Code Example

It's like being at a party with both English and Americans. If someone says, "I've got rocks in my boot and I can't raise my bonnet!" You still don't know for sure whether the subject is automobiles or wearing apparel. Furthermore, both sides of the conversation are very polite and nobody speaks up and says, "Hey! I'm not sure I understand that."

Here's a very simple "Hello About Visual Basic" application built with VSTO and Excel just to give you a flavor of how VSTO works. When you run it, you get this result:

This example, by the way, is an adaptation of an example for VSTO provided by Microsoft MSDN but spiced up a little to show the manipulation of properties and Range selections. Notice also that the VSTO code is enclosed in a Try ... Catch block. That's the only way you can detect an error with VSTO - even in Debug mode.

Explore Visual Basic
By Category
About.com Special Features

Stay connected and entertained with reviews on tips on the latest HDTVs, cellphones and more. More >

Easy ways to connect two computers for networking purposes. More >

  1. Home
  2. Computing & Technology
  3. Visual Basic
  4. Learn VB.NET
  5. Automating Microsoft Office Applications and Managing Processes - Part 1

©2009 About.com, a part of The New York Times Company.

All rights reserved.