[mso] Re: Online VB Classes

  • From: "Greg Chapman" <greg@xxxxxxxxxxxxx>
  • To: <mso@xxxxxxxxxxxxx>
  • Date: Tue, 3 Dec 2002 00:06:29 -0600

Well, yes, there is something else that will make this a lot easier to
catch on to than if you went to a strictly VB course; the macro recorder
in Office Apps. I do recommend Dian's classes on VBA and Word to get
going. But also, record a couple macros within Word or Excel. I'll
cautiously recommend that you use these two apps rather than Access,
Outlook or any of the rest of the Office suite because these two work
more closely to how traditional VB does (although the differences are
slowly disappearing).

If you look at a macro from the standpoint of the result being rather
inflexible (there is no such thing as a variable within a recorded
macro, for instance) and, often, done in a less than optimal fashion,
you can learn about VB structures and the Object Model for the app in
which you recorded it.

When you're done with the course and playing with the macro recorder,
you should know these basics and keep them in mind:
1. VBA, VB and VBScript are almost 100% compatible with each other. For
instance, using the String, InStr, InStrRev and Char functions (to
randomly name just a few) are used identically in all those languages
2. The importance of certain disciplines like declaring a variable and
its type
3. VB code is compiled and can be run without a host. VBA must have a
host app installed, like Word. VBScript must also have a host script
processor like the Windows Script Host or Internet Explorer
4. If you can figure out to how to use a variable, you can greatly
expand the flexibility of a recorded macro.
5. Learning VB(A)(Script) is easy. Learning the object models for the
automation clients like Word is a PITA
6. VB data structures can be complicated but well worth learning
because, like they say in the soaps, data structures live forever!
7. This is the most important if you're aging, like me, and find that
retention is a problem: USE THE STEP-THROUGH DEBUGGER, the IMMEDIATE
Window and the LOCALS Window in the VBA Integrated Development
Environment (IDE)! They'll save your hair, by golly. Facing a nasty
error that you can't figure out for the wealth of data provided (Error
13, Type Mismatch), it's very helpful to step through the code in the
debugger, and type something like "? Vartype(MyGoofyVariable), having
the number 8 returned (the value for a string) and knowing, suddenly,
that this won't work because you sent its value to a function that
expected to see an object variable. Well, Duh!

Yeah, keep this email for a while. It won't make sense now but it might
mean a little something later. The final recommendation is to saturate
yourself in it. Complete immersion makes remembering and learning to use
it all much easier. It's like learning the guitar; 10 minutes every
night is much better than 3 hours on Saturday.

Were I to do this all over again, I wouldn't even be messing with VB
itself. I'd either start within Excel or with raw VBScript. I find Excel
much easier to deal with when dealing with the sort of data I need to
manipulate. But I'd use VBScript more often since I don't have to have
anything other than Windows installed to work with it, unlike VBA. Oh!!
And there's nothing really to be afraid of here except for the time
you'll lose in anger while you're learning.

Greg Chapman
http://www.mousetrax.com 
"Counting in binary is as easy as 01, 10, 11!
With thinking this clear, is coding really a good idea?"


> -----Original Message-----
> From: mso-bounce@xxxxxxxxxxxxx 
> [mailto:mso-bounce@xxxxxxxxxxxxx] On Behalf Of John82654@xxxxxxx
> Sent: Monday, December 02, 2002 10:47 PM
> To: mso@xxxxxxxxxxxxx
> Subject: [mso] Re: Online VB Classes
> 
> 
> In a message dated 12/2/2002 9:05:49 PM Eastern Standard Time, 
> greg@xxxxxxxxxxxxx writes:
> 
> > 
> > And since there are almost no differences between classic VB (as 
> > opposed to VB .Net) and VBA, a VBA course is a great way to 
> begin your 
> > VB education. More advanced topics like writing standard COM DLLs, 
> > transactional threading, etc., are better addressed in standard VB 
> > classes. So a beginner's VBA course should be just as 
> valuable and, in 
> > my opinion, easier to get rolling with.
> > 
> 
> You read my mind Greg,I was just pondering which one would be 
> better to start 
> with? Also,if there's anything else that might prepare a 
> person for this 
> totally confusing and scary program. At least to yours truly,LOL

*************************************************************
You are receiving this mail because you subscribed to mso@xxxxxxxxxxxxx or 
MicrosoftOffice@xxxxxxxxxxxxxxxx

To send mail to the group, simply address it to mso@xxxxxxxxxxxxx

To Unsubscribe from this group, send an email to 
mso-request@xxxxxxxxxxxxx?Subject=unsubscribe

Or, visit the group's homepage and use the dropdown menu.  This will also allow 
you to change your email settings to digest or vacation (no mail).
//www.freelists.org/webpage/mso

To be able to use the files section for sharing files with the group, send a 
request to mso-moderators@xxxxxxxxxxxxx and you will be sent an invitation with 
instructions.  Once you are a member of the files group, you can go here to 
upload/download files:
http://www.smartgroups.com/vault/msofiles
*************************************************************

Other related posts: