Understanding the Excel Object Model and Key Objects
Richard Mansfield · 2019
This chapter shows how to start working with the Excel object model, the architecture underlying Excel. It also shows how to perform common tasks with the most frequently useful Excel objects. These objects include the Workbooks collection and the Workbook object, the ActiveCell object, and Range objects. Most workbooks VB developers needs to manipulate via visual basic for applications (VBA) will contain one or more worksheets. As a result, many macro procedures will need to work with worksheets—inserting them, deleting them, copying or moving them, or simply printing a range from them. Each worksheet is represented by a Sheet object. The Sheet objects are contained within the Sheets collection. In a procedure that manipulates a selection that the user has made, VB developers will typically work with either the active cell or the selection. The active cell is always a single cell, but the selection can encompass multiple cells or other objects.