Wednesday, June 19, 2013

Where we can write VBA

Leave a Comment
Likes other programming languages, they need the editor to write the Code. For VBA programming, it has its own editor that is built-in the Microsoft Office Application. In order to go the VBA Editor in Word, Excel, Power Point, Outlooks or Access, we can go to Developer Tap and Click on the Visual Basic or you can use Alt+F11 to go to VBA Editor. With the VBA editor we can write the VBA Code in Standard Module or Class Module.

Standard
A page that contains VBA code that is accessible to all objects in the Microsoft application. A standard Module always exists in the Modules Group in the Navigation Pane.

Class
Class is a page of VBA code that is attached to every form and reports you create. You can also create a class module that appears in the Navigation Pane.

Difference between Standard Module and Class Module
The main difference between a standard module and a class module is that you can create an instance of your class module in code. A standard module contains procedures you can run from anywhere in your Word, Excel, Power Point, Outlooks, and Access. A class module contains code that is either attached to an existing form or worksheet etc… in its own entity in the Navigation Pane.

We just talk about the where we can write the VBA code. For the following figure, we will show where is the VBA is stored within Access Database.


Figure 1


Summary

We can write the VBA code in the VBA editor. In VBA editor contains
Standard: A page that contains VBA code that is accessible to all objects in the Microsoft application.

Class: a page of VBA code that is attached to every form and reports you create.

0 comments :

Post a Comment

DMCA.com Protection Status