View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Auric__ Auric__ is offline
external usenet poster
 
Posts: 538
Default Trying to Learn VB

On Mon, 14 Jun 2004 13:44:22 -0500, sowetoddid
wrote:

I have clicked on all of the links that I can find posted in this forum,
trying to learn how to compile VB codes. A lot of the codes make
sense, except for the extra info the gets stuck between lines. Does
anyone know a good webpage that analyzes codes line by line, explaining
what each part does?


No, but then, I never had reason to look. Try Googling for something
like:
online "visual basic" "lexical analyzer"
(with quotes). I doubt you'll find anything, but it's worth a shot.

What is the significance of...

(Cancel As Boolean)


Read Mr. Phillips' msg.

and

(By Val SaveAsUI As Boolean, Cancel As Boolean)


ByVal (one word, not two) makes a copy of the variable (in this case,
SaveAsUI - the name is unimportant, BTW - it could just as easily be
called X or myDogHasFleas) and passes the copy to the called procedure,
instead of the original variable. This prevents the called procedure
from altering the original variable. ByVal is not the default behavior -
that would be ByRef, which just passes the original variable without
making a copy. This allows the called procedure to directly change the
variable. (That's a bit simplified, but what I left out would probably
just confuse you even more, I bet.)

I see these in codes coming after Private Sub Workbook_BeforePrint


They're part of the declaration of the sub; they are parameters sent to
the procedure and can affect how the procedure operates. You see the
same sort of thing with almost all built-in keyword, such as MsgBox:
MsgBox (Prompt, Buttons, Title, [etc])
With MsgBox, the parameters can affect what's displayed as the message,
what buttons are shown, etc.


Now, I hate to be the one to tell you this, but based on your questions,
you appear to be unfamiliar with some fundamental concepts of
programming, and this really isn't the place to start from scratch.
You're far better off coughing up some money for either a book or a
class. Microsoft Press (and likely others, but I haven't looked)
publishes books specifically about programming MS Office (I have
_Microsoft Office 97/Visual Basic Programmer's Guide_; cost me US$34.99
five years ago). Many (most?) colleges offer programming classes; see if
your local community college (or whatever) offers a class on programming
Visual Basic (but not QBasic or generic BASIC).
--
auric underscore underscore at hotmail dot com
*****
Custer's Last Photo-Op