Microsoft Office Tutorials and References
In Depth Information
Controlling objects is fundamental to developing applications. Throughout this topic,
you find out how to automate tasks by controlling Excel’s objects, and you do so by
using VBA. This concept becomes clearer in subsequent chapters.
The most common Excel object is a workbook. Everything that you do in Excel takes place in a
workbook, which is stored in a file that, by default, has an XLSX extension. An Excel workbook
can hold any number of sheets (limited only by memory). There are four types of sheets:
h Chart sheets
h Excel 4.0 XLM macro sheets (obsolete, but still supported)
h Excel 5.0 dialog sheets (obsolete, but still supported)
You can open or create as many workbooks as you like (each in its own window), but at any
given time, only one workbook is the active workbook. Similarly, only one sheet in a workbook is
the active sheet. To activate a sheet, click its sheet tab at the bottom of the screen. To change a
sheet’s name, double-click the tab and enter the new text. Right-clicking a tab brings up a
shortcut menu with additional options for the sheet, including changing its tab color, hiding the sheet,
and so on.
You can also hide the window that contains a workbook by using the View➜Window➜Hide
command. A hidden workbook window remains open, but it isn’t visible to the user. Use the
View➜Window➜Unhide command to make the window visible again. A single workbook can
display in multiple windows (choose View➜Window➜New Window). Each window can display a
different sheet or a different area of the same sheet.
The most common type of sheet is a worksheet, which is what people normally think of when
they think of a spreadsheet. Worksheets contain cells, and the cells store data and formulas.
Excel 2010 worksheets have 16,384 columns and 1,048,576 rows. You can hide unneeded rows
and columns to keep them out of view, but you can’t increase or decrease the number of rows or
Versions prior to Excel 2007 used the XLS binary format, and worksheets had only
65,536 rows and 256 columns. If you open such a file, Excel 2010 automatically enters
compatibility mode in order to work with the smaller worksheet grid. To convert such a
file to the new format, save it as an XLSX or XLSM file. Then close the workbook and