Canalblog
Editer l'article Suivre ce blog Administration + Créer mon blog
Publicité
SpireXLS
5 décembre 2010

Excel Application Objects in VBA Objects

After learning the basic knowledge of VBA and knowing how to write and run program, do you want to know how to control Excel automatically? Excel is organized by objects so that we need to learn Excel VBA Objects firstly if automating Excel.
There are hundreds of Excel Objects. When using Microsoft Excel, some are helpful, while some others are not. Before learning Excel Objects, we should research objects, ways, properties, events which are related to operation. Generally, Excel Objects include Application, Workbook, Worksheet and Range. These four objects are often used when using Excel. It is easy to quote an object through VBA code if knowing its location of Excel Objects. And Excel can be automated according to your acquirements when operating objects and organize them.

 

Excel Application Object can be considered as the entire Excel. Some Application of properties control Excel conditions and formats. For example, the Screen Updating property is set as True. In addition, Cursor property controls appearance of pointer. Edit Directly In Cell property can control if you can edit cells in worksheet directly, or you just can edit cells in formula. Some Application properties can come back to objects, such as, ActiveCell can be back to current cell in Window, Sheets can be back to worksheet object assembly and so on. Application Objects also provide other ways to allow you to operate. For example, Calculate allow you to recalculate all the opened workbooks or certain workbook. Application Objects can deal with Excel by properties or methods as well.

 

Application Objects have a lot of events. For example, once one worksheet is activated, one SheetActivate event will be generated. When cells are changed, SheetChange will run. SheetSelectionChange happens while the selection area is changed. Application Objects provides events for dealing with Window Object. Window Activate run on the moment any window is activated, while WindowDeactivate run when stopping. What’s more, Application Objects provides events to interact with any Workbook Object.

 

Therefore, Excel Application Object is the most important and center of Excel VBA Objects.

Publicité
Publicité
Commentaires
SpireXLS
Publicité
Publicité