1. Introduction to the Excel Object Model
Application: Microsoft. Office. InterOP. Excel. Application
Workbook: Microsoft. Office. InterOP. Excel. Workbook
Worksheet: Microsoft. Office. InterOP. Excel. Worksheet
Range: Microsoft. Office. InterOP. Excel. Range
Application: can be understood as ExcelProgramProcess. To use Excel, you must enable the EXCEL program. This program can be considered as an application.
Workbook: workbook. An Excel program can operate multiple Excel files at the same time. Each Excel file is actually a workbook. Of course, an applicatioin contains multiple workbooks.
Worksheet: a sheet. A Workbook can have multiple sheet pages.
Range: editing area. You can select an editing area. It is an abstraction of this area. It can be multiple cells, so cells [I, j] can be directly converted to range.
These are the most important objects.
Ii. Classic Hello world.
1. Create a project, office, and office 2010 workbook
2. Drag a button from the toolbar and place it on the sheet page.
3. Double-click this button to add events
4.Code:
Excel. Range RNG = globals. sheet1.range ["A1", missing];
RNG. value2 = "Hello World ";
5. Run the command to view the effect. Click A1 to check whether Hello world is displayed?
Globals is a global object reference,