O'Reilly logo

VSTO 3.0 for Office 2007 Programming by Vivek Thangaswamy

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Working with ranges

Microsoft Office Excel is loaded with a wide variety of objects that can be programmed for using VSTO 3.0. The Range object is probably the most frequently-used object in the Excel object model, and helps an Excel developer to manipulate the cells and their data by using a referenced range. In this section, we will see how to refer to cells programmatically, and manipulate the ranges of data in Microsoft Office Excel 2007. The Excel range is a vital part of the Excel application. A range may correspond to a logical relationship between cells.

The following sample program explains how to read the cells of a worksheet by using the Range object, and how to format the background color of a range of cells.

Open Visual Studio 2008 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required