• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint

Working with Events

Another powerful feature in VBA is the ability to use project-level and application-level events to trigger the execution of some code that you have written. Project events occur when the project changes, and Application events occur when a project is created. There are fewer Project events, and they are simpler to use, so they are covered here first.

An example of a project-level event is the Project_Open event. You can write some code, and whenever that project opens, the code can automatically be executed. A typical use of the Project_Open event is to trigger setting up the environment by customizing the toolbars and menus. Another use would be to open and write to a file use log. This section uses the event to pop up a simple window.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint