Friday, August 12, 2005

VBA - Objects and Events

First things first! If you haven't finished creating your custom form for student information, then do so now, as we'll be building on this example a bit later. We'll re-cap what we've learned so far about VBA... Sub's, MsgBox's,InputBox's and IF statements, with a quick VBA activity sheet!

Last week Justin was asking if we can learn how to make windows open all over the screen... (like a virus I think)... to learn how to do this (as well as other useful functions!) we need to start getting to know the Excel Object model. And what do you know, Microsoft have put together the Super-Easy Guide to the Microsoft Office Excel 2003 Object Model (Remember, right-click to open the link in a new window)!

Work in groups of 2 or 3 to answer the following questions, writing your answers on a piece of paper:
  1. What are the three windows that are displayed in the VBA Editor?
  2. After working through Lesson 3, give an example of an Object, a Method and a Property using an object from every-day life (such as a kettle - it could have a property called currentTemperature and a method called Boil(), but you can't use that now 'cause you've got to come up with something yourself!)
  3. Try to find the three objects, three methods and three properties in Hands-on Task 3!
  4. After working through Lesson 4 together, what is the name of the event that you need to use to complete Hands-on challenge 4?
If your team finishes early, have a go at going back to your Student Info application and see if you can now add code so that your form is shown as soon as the Excel Workbook is opened.

0 Comments:

Post a Comment

<< Home