ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Difference between VB and VBA? (https://www.excelbanter.com/excel-programming/379423-difference-between-vbulletin-vba.html)

Mike

Difference between VB and VBA?
 
Hi everyone,

What exactly the difference between VB and VBA?

Thanks,
Mike


John Coleman

Difference between VB and VBA?
 
The core language (syntax, control flow, etc) are exactly the same (if
you are comparing VB6 with VBA - all bets are off if you are talking
about VB.Net). The main difference is that VB can make stand-alone
executables whereas VBA must be hosted in an application like Excel to
run. Another difference is that VB is fully compiled but VBA is only
partially compiled (into "p-code") which is then run on an interpreter.
Thus a VB program will be quicker than the corresponding VBA program
(but not by as much as you might think - the partial compilation of VBA
makes it much closer to VB than to the purely interpreted VBScript).

HTH

-John Coleman

Mike wrote:
Hi everyone,

What exactly the difference between VB and VBA?

Thanks,
Mike



Mike

Difference between VB and VBA?
 
Now, say you have created a macro in Excel. Can you take its VBA code
and convert it into a VB one?

If yes, can you give an example please?

Thaks,
Mike



Jim Thomlinson wrote:
In the grander scheme of things not too much. Visual Basic is a Computer
language like C/C++/C# or Java or Delphi or... Visual Basic for application
is the same language addapted to work with a number of different
applications. Both VB and VBA use the same core engine. VB adds a bunch of
functionallity for creating DLL's and such that VBA does not have. VBA is
adapted to work with the object model for each of the applications it is
partnered with. For example VBA for Excel is designed to work with the Excel
object model of Workbooks, Worksheets and Ranges.

One of the biggests differences is that VB will create compiled stand alone
executable files. VBA can not stand alone. While you can "in a manner of
speaking" compile VBA it does not create an executable file.

If you were to take a course in VB it would be very applicable to gaining a
better understanding of VBA and Vice Versa...
--
HTH...

Jim Thomlinson


"Mike" wrote:

Hi everyone,

What exactly the difference between VB and VBA?

Thanks,
Mike





All times are GMT +1. The time now is 08:05 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com