Excel VBA | Excel Object Model

VBA stands for visual basic for applications. VBA is a programming language which is used to customize MS Excel features through piece of code. AS its name suggests, VBA infact is Visual Basic style of programming. Every office application like MS word or Ms excel has built-in Visual Basic 6 editor. Using this editor we can programmatically handle or customize feature of MS office applications.

VBA can be used in any Office Application like MS Word, MS PowerPoint, MS Access or in MS Excel. To work with a specific application you are required to learn objects contained in that particular application. Many modern programming languages like VB.Net work around objects. In addition to working with pre-defined objects, you can create your own objects in these languages. VBA is an object based language but you are not required to create new objects in VBA. You will work with pre-defined set of objects. Objects in Ms Excel are arranged in a specific manner. The structure of objects in MS Excel is known as Excel Object Model.

If you are interested in Excel VBA, you must understand Excel Object Model. In Excel every component is an object. A worksheet is an object, a chart is an object. A cell or collection of cells is represented by RANGE object. Each object has some properties, methods and events associated with it. We can manipulate these objects using these methods and properties. For example we can change the data inside a cell using RANGE object. We can programmatically print a sheet in workbook using PRINTOUT method of WORKSHEET object. We can copy content of cell to another cell using COPY method of RANGE object. So working in VBA is just working with these objects. All core programming tools like LOOPs and control structures are provided in VB language. By using Excel Objects with all power of Vb language, we can solve our problem with ease, speed and style. Similarly, if you are working in Ms Word, you will work with objects like PARAGRAPH, DOCUMENT etc.

In Excel object model, EXCEL APPLICATION is top most objects. Then comes the WORKBOOK object, then WORKSHEETS and then others small objects like RANGE, CHARTS etc. More than 200 objects are available in EXCEL VBA 2007. You can visit following link to explore more details of Excel Object Model

http://msdn.microsoft.com/en-us/library/bb149081.aspx

Leave a Reply

Name and Email Address are required fields. Your email will not be published or shared with third parties.