Organization of This Book

Writing Excel Macros consists of 21 chapters that can informally be divided into four parts (excluding the introductory chapter). In addition, there are five appendixes.

Chapter 1 examines why you might want to learn programming and provides a few examples of the kinds of problems that can best be solved through programming. Chapter 2 introduces programming and the Visual Basic for Applications language.

Chapter 2 through Chapter 4 form the first part of the book. Chapter 3 and Chapter 4 examine the Visual Basic Integrated Development Environment (IDE), which is the programming environment used to develop Excel VBA applications.

The second part of the book consists of Chapter 5 through Chapter 8, which form an introduction to the VBA language, the language component that is common to Microsoft Visual Basic and to many of Microsoft's major applications, including Word, Excel, PowerPoint, and Access, as well as to software from some other publishers. Individual chapters survey VBA's variables, data types, and constants (Chapter 5), functions and subroutines (Chapter 6), intrinsic functions and statements (Chapter 7), and control statements (Chapter 8).

The third part of the book is devoted to some general topics that are needed to create usable examples of Excel applications and to the Excel object model itself. We begin with a discussion of object models in general (Chapter 9). The succeeding chapters discuss what constitutes an Excel application (Chapter 10), Excel events (Chapter 11), Excel menus and toolbars (Chapter 12), and Excel dialog boxes, both built-in and custom (Chapter 13 and Chapter 14). (Those who have read my book Learning Word Programming might notice that these topics came at the end of that book. While I would have preferred this organization here as well, I could not construct meaningful Excel examples without covering this material before discussing the Excel object model.)

The last chapters of the book are devoted to the Excel object model itself. This model determines which elements of Excel (workbooks, worksheets, charts, cells, and so on) are accessible through code and how they can be controlled programmatically. Chapter 15 gives an overview of the Excel object model. Subsequent chapters are devoted to taking a closer look at some of the main objects in the Excel object model, such as the Application object (Chapter 16), which represents the Excel application itself; the Workbook object (Chapter 17), which represents an Excel workbook; the

Worksheet object (Chapter 18), which represents an Excel worksheet; the Range object (Chapter 19), which represent a collection of cells in a workbook; the PivotTable object (Chapter 20); and the Chart object (Chapter 21). Chapter 22 covers Smart Tags. I have tried to include useful examples at the end of most of these chapters.

The appendixes provide a diverse collection of supplementary material, including a discussion of the Shape object, which can be used to add some interesting artwork to Excel sheets, determining what printers are available on a user's system (this is not quite as easy as you might think), and how to program Excel from other applications (such as Word, Access, or PowerPoint). There is also an appendix containing a very brief overview of programming languages that is designed to give you a perspective on where VBA fits into the great scheme of things.

0 0

Post a comment