What is the difference between VB and VBScript?
This is a very old question, but existing answers are outrageously vague, and/or fail to identify the most important stuff, when they're not just plain wrong. Not going to repeat what other answers already indicate, but the following differences are missing from the other answers:
VBScript code doesn't need procedure scopes: it can be written as a [drumroll] script that just executes a bunch of procedural operations top-to-bottom.
In VB6/VBA executable statements can only exist inside procedure scopes.
In VBScript everything (variables, function return values, etc.) is a Variant
(i.e. pretty much a duck, like in JavaScript). It is illegal to declare an explicit type when declaring a variable. The As
keyword is illegal!
In VB6/VBA everything defaults to an implicit Variant
, but good VB6/VBA code uses explicit types where applicable.