tags:

views:

182

answers:

4

I would like to learn some VB because I am interested in a few industries that tend to use it exclusively. However, I find most resources far to slow in teaching the language and tools because they are aimed for those who haven't programmed before. Is there a good guide for programmers with experience in other languages like java and ruby?

Thanks, Steven

+3  A: 

The best way to learn is to fire up excel, or whatever version of VBA you're going to use (yes they are subtly different). Turn on the macro recorder, do some stuff, stop recording and then look at the code created. You'll immediately see some of the classes created, they can be looked at in more detail using the Object Explorer within the VBA environment. The syntax is just like any basic language. A couple of good practises, put the line 'Option Explicit' at the top of every source file, if not variables don't need to be declared, which is initially easy but leads to annoying bug hunts.

I'm not aware of a one stop shop to learn VBA, as you've already got programming experience it'll be a matter of unlearning some stuff - like OO, inheritance etc (yes I know VBA supports classes and interfaces but they're not the full enchilada).

BTW I noticed you tagged this as VB.Net, unfortunately VB.Net is not VBA - they're not related at all. Similarly VB and VBA are not the same although the overlap is about 90%.

MrTelly
thanks, I updated the tag accordingly
Steven Noble
Well, VBA is the language, VB is just another host for VBA.
projecktzero
+2  A: 

Writing Excel Macros with VBA, 2nd Edition by Steven Roman, ch. 5-8 has a reasonably compact tour of VBA syntax, built-in functions, etc. You can find it on Google Books. Most of what it says should apply to VB6 as well.

There is also the Visual Basic 6.0 Programmer's Guide available for free on MSDN

However, MrTelly has the best advice if you're already familiar with programming in general. The Excel VBA editor, the macro recorder, and the F1 key are probably all you need, plus the basic help on specific syntax for control structures, etc.

jtolle
+1  A: 

This might be helpful.

Quite a few years ago a DDJ's columnist calling herself Verity Stob wrote a good summary of typical gotchas awaiting an experienced programmer starting developing with VB/VBA:

http://www.ddj.com/windows/184403996;jsessionid=HZEBCTTLEH5XGQSNDLPCKH0CJUNN2JVN?_requestid=378977

Alexander Shirshov
A: 

Excel is a good place to learn VBA.

A good resource is the book VB/VBA In a Nutshell

projecktzero