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 ...

Get VSTO 3.0 for Office 2007 Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.