Chapter 8. Putting Customers into Excel

In This Chapter

  • Accessing remote data

  • Working with the Action pane

  • Lining up Word and Excel controls

VSTO is designed with business in mind. Office is the reigning tool for line-of-business applications worldwide, and VSTO is the programming toolset for that tool. In this chapter, you put some business into Excel by customizing an Excel document.

You start by constructing some basic functions around a business problem with Excel. Then, we show you some neat tricks with the Action pane that represent some of the most common uses of VSTO technology in the real line of business applications.

Customizing Excel Workbooks

Workbooks, worksheets, charts, and tables in Excel are parts of a document, just as paragraphs, words, images, and pages are in Word. The principles we explain in Chapter 6 also apply to Excel workbooks. Even though Excel is a different application than Word, some concepts apply to both applications. In fact, when you add controls, data sources, ribbons, and Task panes to Word or Excel, the only difference is the host application itself.

Excel, like Word, has a Range object, which represents a group of cells or a single cell. The VSTO Excel project is structured similar to the Word project in Chapter 6 but has four different code files:

  • Sheet1.vb

  • Sheet2.vb

  • Sheet3.vb

  • ThisWorkbook.vb

The first three classes represent each worksheet inside an Excel workbook. The class ThisWorkbook represents the whole workbook — similar to the class ThisDocument ...

Get VSTO For Dummies 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.