+ Reply to Thread
Results 1 to 8 of 8

Difference between VB and VBA

  1. #1
    Registered User
    Join Date
    07-24-2010
    Location
    Singapore
    MS-Off Ver
    Excel 2003
    Posts
    3

    Difference between VB and VBA

    Hi all,

    I read from various forums/websites that it appears VB and VBA is highly similar and if I first learn VB then programming in VBA will have practically no problems at all. Is this correct ?

    I am a new starter to VB (and VBA), I am reasonably proficent with Excel and Excel formulas but would like to take my Excel expertise to another level. Any suggestion if I should first focus on

    1. learning VB language first ? , or
    2. just go directly into VBA.

    One side question and immediate difference I note in VBA and VB is

    In VB, I can do this
    Please Login or Register  to view this content.
    But I cannot do the same in VBA. In VBA, the above will pose an error and it appears it has to be broken up into two parts for it to work as
    follows:-

    Please Login or Register  to view this content.
    Any ideas why ?
    Last edited by royUK; 07-24-2010 at 02:46 PM. Reason: add code tags

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Difference between VB and VBA

    Any ideas why ?
    They're different languages.

    Where you start depends on what you want to do. If you intend to automate Office products, then the larger task is becoming familiar with the object models of those applications, and I'd start with VBA, if for no other reason than that it has a compact, simple, integrated development and debug environment.
    Last edited by shg; 07-24-2010 at 02:23 PM.
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Difference between VB and VBA

    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code. Posting code without them makes your code hard to read and difficult to be copied for testing. Highlight your code and click the # at the top of your post window. For more information about these and other tags, found here
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  4. #4
    Forum Expert
    Join Date
    07-16-2010
    Location
    Northumberland, UK
    MS-Off Ver
    Excel 2007 (home), Excel 2010 (work)
    Posts
    3,054

    Re: Difference between VB and VBA

    If you're looking to learn a programming language then Visual Basic is now obsolete, having been replaced by VB.Net, which is quite different.

    In terms of the difference between VB and VBA - most of the time in VBA you're dealing with the functionality of a complete application and will use terminology which has no direct equivalent in VB.

    If you work with forms a lot in Excel then that is much closer experience to programming in VB, although I always feel as if Microsoft randomly commented out bits of useful VB functionality for VBA. For example, control arrays are missing in VBA forms, which can be a right pain in the bum sometimes.

    Personally I prefer VBA in Excel to pure VB, because it comes with a vast 3D database attached and a user interface that most desktop users are familiar and happy with.

  5. #5
    Registered User
    Join Date
    07-24-2010
    Location
    Singapore
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: Difference between VB and VBA

    Dear all,

    Thank you for your replies.
    On your note that VB is now obselete, wonder if you can elaborate a little more.
    I am just about to start learning VB (as I was under the impression VBA and VB is substantially similar) but if this is indeed not the case and if VB is going to be completely phased eventually... I will have to rething if I want really want to learn VB at all or not, if it would be better if I start to learn VB.NET instead.

    1. I want to basically (i) automate tasks and (ii) build simple programmes with Microsoft Office, for now, particularly in the Excel environment.
    2. Would learning VB. NET or VB be helpful/complimentary to what I want to achieve in (1) above?
    3. If yes to (2), which language VB.NET or VB it be more advantageous or relevant in terms of helpfulness in and being complimentary to achieving (1) - VB.NET or VB ?
    4. I am still seeing large volumes of books being published even for VB 2010. Wonder if VB is really getting obselete?

    Thanks in advance for your advice. Cheers!
    Last edited by shg; 07-25-2010 at 12:27 AM. Reason: deleted quote

  6. #6
    Forum Expert
    Join Date
    07-16-2010
    Location
    Northumberland, UK
    MS-Off Ver
    Excel 2007 (home), Excel 2010 (work)
    Posts
    3,054

    Re: Difference between VB and VBA

    Whether VB is obsolete is unrelated to whether people are still using it or writing books about it. Microsoft stopped supporting VB two years ago, but it still has a large user community.

    Anyway, based on what you've said I'd think that VBA is what you need to know about, I doubt learning either VB or VB.Net separately would help you learn VBA to any extent.

  7. #7
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Difference between VB and VBA

    Quote Originally Posted by dage
    I want to basically (i) automate tasks and (ii) build simple programmes with Microsoft Office, for now, particularly in the Excel environment.
    I think shg covered this best

    Quote Originally Posted by shg
    If you intend to automate Office products, then the larger task is becoming familiar with the object models of those applications, and I'd start with VBA
    VBA might be deemed a "legacy" programming language these days, however, it still has a significant role to play.

  8. #8
    Registered User
    Join Date
    07-24-2010
    Location
    Singapore
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: Difference between VB and VBA

    Hi,

    Thanks for your reply. I found some other sources on the web (not saying they are definitely correct but would like to get more insights and see if I can get any confirmation or further elaboration from the experts here).
    Found the following form wikipedia website:

    http://en.wikipedia.org/wiki/Visual_Basic_.NET

    Visual Basic 2005 (VB 8.0)

    Visual Basic 2005 is the name used to refer to the update to Visual Basic .NET, Microsoft having decided to drop the .NET portion of the title.

    Visual Basic 2008 (VB 9.0)

    Visual Basic 9.0 was released together with the Microsoft .NET Framework 3.5 on November 19, 2007.
    Relation to older versions of Visual Basic (VB6 and previous)

    Whether Visual Basic .NET should be considered as just another version of Visual Basic or a completely different language is a topic of debate. This is not obvious, as once the methods that have been moved around and that can be automatically converted are accounted for, the basic syntax of the language has not seen many "breaking" changes, just additions to support new features like structured exception handling and short-circuited expressions. Two important data type changes occurred with the move to VB.NET. Compared to VB6, the Integer data type has been doubled in length from 16 bits to 32 bits, and the Long data type has been doubled in length from 32 bits to 64 bits. This is true for all versions of VB.NET. A 16-bit integer in all versions of VB.NET is now known as a Short. Similarly, the Windows Forms GUI editor is very similar in style and function to the Visual Basic form editor.

    The version numbers used for the new Visual Basic (7, 7.1, 8, 9, ...) clearly imply that it is viewed by Microsoft as still essentially the same product as the old Visual Basic.
    ...

    This is what I am really trying to do or have gathered based on what I found out on the web and also your helpful responses:-

    1. It is likely that I will just focus on VBA for now as my primary goal is learn how to automate tasks for Microsoft office applications.
    2. But I am also keen to learn another language, if I have the time, if possible, something similar and close to VBA. It appears to me, VB is probably the closest in language form and syntax to VBA.
    3. Following from (2), I went to buy a Visual Basic 2008 book (hope its not money wasted).

    Can anyone tell me if Visual 2008 is indeed VB.NET (the last version of VB.NET I found on the internet appears to be VB.NET 2003. All other versions of VB from VB.NET 2003 onwards are only known as VB 2005, VB2008 and VB2010.

    Is VB2008 and VB 2010 same as VB.NET ? This is important to me as I do not want to learn an obselete language. Thanks in advance.

    Regards,



    Quote Originally Posted by Andrew-R View Post
    Whether VB is obsolete is unrelated to whether people are still using it or writing books about it. Microsoft stopped supporting VB two years ago, but it still has a large user community.

    Anyway, based on what you've said I'd think that VBA is what you need to know about, I doubt learning either VB or VB.Net separately would help you learn VBA to any extent.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1