+ Reply to Thread
Results 1 to 11 of 11

difference between VBA and Visual Basic

  1. #1
    Forum Contributor
    Join Date
    11-17-2015
    Location
    India
    MS-Off Ver
    2013
    Posts
    365

    difference between VBA and Visual Basic

    Hi,

    Can anyone tell men the difference between VBA and VB?

    Are they totally different?.

    If totally different which one is advanced?

    If I learn VB, will i be able to write code for excel VBA?

    What is the basic requirement to lear VB/VBA? is it necessary to be a programmer?

    How to learn VB/VBA step by step?

  2. #2
    Valued Forum Contributor Neil_'s Avatar
    Join Date
    04-19-2013
    Location
    Yorkshire
    MS-Off Ver
    Office 365 Enterprise E3 2013 / 2016
    Posts
    479

    Re: difference between VBA and Visual Basic

    VB has now been replaced by .NET framework. You need Visual Studio Express to create .NET projects. .NET projects are stand alone applications and whilst the editor and Syntax are similar to VBA, you have to code everything in a project yourself. Whilst you will learn to program, you won't learn anything about Excel's object model by learning .NET

    VBA for applications uses the VB base language for automating the applications in Microsoft Office. Learning VBA will teach you all about the Office application's object models. You will earn how to integrate Excel with Emails, Access record sets with Excel spreadsheets and everything in between. Learning VBA won't teach you anything about creating stand alone applications in .NET.

    Learning any language, .NET, C#, Java, Python, Fortran, VBA will make it easier to learn another. As syntax is similar between .NET and VBA, transitioning between the two would be less painful.
    Last edited by Neil_; 09-07-2016 at 02:38 AM.
    Frob first, tweak later

  3. #3
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    365 Win 11
    Posts
    7,238

    Re: difference between VBA and Visual Basic

    The biggest issue you'll have transitioning is that vba isn't really object orientated, vb is

  4. #4
    Valued Forum Contributor Neil_'s Avatar
    Join Date
    04-19-2013
    Location
    Yorkshire
    MS-Off Ver
    Office 365 Enterprise E3 2013 / 2016
    Posts
    479

    Re: difference between VBA and Visual Basic

    I can see this thread quickly turning into the merits of OOP, C vs C# et al. The OP probably won't have a clue what OOP is. VBA can be completely object oriented if you want to make it that way, class modules are available if you want to create them, Excel's entire object model from Application to Cell.ColorIndex is object oriented, it's just that people learn initially from recorded macros which are inevitably script style and continue to program in that vein. Also, as VBA routines are generally small, there is little incentive to code with your OOP hat on.
    Last edited by Neil_; 09-07-2016 at 03:36 AM.

  5. #5
    Valued Forum Contributor Neil_'s Avatar
    Join Date
    04-19-2013
    Location
    Yorkshire
    MS-Off Ver
    Office 365 Enterprise E3 2013 / 2016
    Posts
    479

    Re: difference between VBA and Visual Basic

    As an aside, I think this must be one of the most common general questions asked when people start to get interested in programming through learning VBA. The biggest thing to consider is, whilst hacking a little code together in VBA to make you more productive at work is one thing, learning a programming language from scratch is another. If you are serious, you must understand that to do it properly, you will be committing months / years of your life to it, so make a decision based on how it will benefit you in the long run, and what you want to achieve in your career before committing. There are countless discussions on the internet about this, so do your research first. Many dis .NET as a kid's language, even though it compiles to to exactly the same code as C#. Others will dis C# as they say it is not portable and that you should learn C++. This may be the case, but there are plenty of job opportunities out there for C# [programmers] as this is the native language for Windows.
    Last edited by Neil_; 09-07-2016 at 03:57 AM.

  6. #6
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    365 Win 11
    Posts
    7,238

    Re: difference between VBA and Visual Basic

    .net isn't a language, it's a framework. C# and VB both use .net and both compile to the same code so it's purely personal preference. I don't think there is such a thing as portable code (unless you are talking about truly trivial applications) the closest you'll get is something that runs in a vm so something like Java or JavaScript, but even then there are issues with it being portable.

  7. #7
    Valued Forum Contributor Neil_'s Avatar
    Join Date
    04-19-2013
    Location
    Yorkshire
    MS-Off Ver
    Office 365 Enterprise E3 2013 / 2016
    Posts
    479

    Re: difference between VBA and Visual Basic

    C++ is considered portable as the code you write will run on many platforms. It will run on Windows if you include the necessary libraries before compilation. C# uses libraries only compatible with Windows so is not considered portable.

    I can see this thread quickly turning into the merits of OOP, C vs C# et al
    I think it's time for me to duck out of this thread as I don't think I can contribute anything else meaningful to the OP's question.
    Last edited by Neil_; 09-07-2016 at 06:03 AM.

  8. #8
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    365 Win 11
    Posts
    7,238

    Re: difference between VBA and Visual Basic

    That's not strictly true, have a look at https://www.microsoft.com/net/core

  9. #9
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    365 Win 11
    Posts
    7,238

    Re: difference between VBA and Visual Basic

    Quote Originally Posted by Neil_ View Post
    I can see this thread quickly turning into the merits of OOP, C vs C# et al. The OP probably won't have a clue what OOP is. VBA can be completely object oriented if you want to make it that way, class modules are available if you want to create them, Excel's entire object model from Application to Cell.ColorIndex is object oriented, it's just that people learn initially from recorded macros which are inevitably script style and continue to program in that vein. Also, as VBA routines are generally small, there is little incentive to code with your OOP hat on.
    How does one perform inheritance in VBA (discounting interface inheritance)? That's a core requirement for something to be "completely" object orientated. To be explicit, I'm not VBA bashing/spouting the merits of OOP, VBA is simple and useful for automation as you describe, but getting one's head around OOP coming from a VBA background is significantly harder than learning loops, the danger with VB.Net is that it sort of looks like VBA/VB6 but doesn't behave like it leading to frustration. I know developers who jumped to C# from VB6 simply because of this.

    If I didn't like VBA, I wouldn't hang round here and I agree with 99% of what you said

  10. #10
    Forum Expert Doc.AElstein's Avatar
    Join Date
    05-23-2014
    Location
    '_- Germany >Outside Building things.... Mostly
    MS-Off Ver
    Office 2003 2007 2010 PC but Not mac. XP and Vista mostly, sometimes Win 7
    Posts
    3,618

    Re: difference between VBA and Visual Basic

    Hi saravanan1981,
    Adding a Layman’s input / answers to some of your questions:
    ( _...._... I started as a complete computer idiot a couple of years ago ....
    I learnt some basic computing 25 years ago, Pascal, Fortran, Basic etc..
    I hit “OOP” ( Object Orientated Programming ) for the first time a couple of years ago..
    The only course available to me was a short Night School Course titled "VB/ Programming/ OOP". It was a basic introduction to programming. It used Visual Basic 2010.
    I found OOP weird, but got used to it....._....)


    Quote Originally Posted by saravanan1981 View Post
    Can anyone tell me the difference between VBA and VB?
    Are they totally different?.
    If totally different which one is advanced?.......
    My first PC had Office including VBA. Naively I thought it was the same as VB. From the laymen’s viewpoint, I found the Forms Side of VB ( which I think is what you usually learn first in VB ) very similar to the UserForms in VBA.
    _..................................

    Quote Originally Posted by saravanan1981 View Post
    ..
    Are they totally different?.
    ...If I learn VB, will i be able to write code for excel VBA?....?
    The actual coding I found, as a Beginner, very similar. The Basic OOP Programming course in VB that I took part in got me started in VBA ( I note that technically VBA is not a OOP language, ( many experts have told me this, as discussed in this Thread ) but for a Beginner, for all intents and purposes, it appears so )

    _...................................

    Quote Originally Posted by saravanan1981 View Post
    ....What is the basic requirement to lear VB/VBA? is it necessary to be a programmer?...
    You will find that the Experts in this Forum range from very experienced professional programmers to people with no formal education in programming or in some case much education at all. It appears anyone can VBA !!

    _...........................


    Quote Originally Posted by saravanan1981 View Post
    ....
    How to learn VB/VBA step by step?
    Most people will tell you that practice and participations in Excel Forums is the best way. But also some you Tube Videos can be helpful:
    http://www.excelforum.com/showthread...00#post4272300

    If you attend any introduction course on programming that explains OOP and demonstrates basic coding techniques, such as looping, then that will get you started for both VBA or VB.
    But I would keep in mind the important comments from the experts here, regarding the differences should you be considering a long term career in computing. Up until now, only very occasionally have things like VBA not being a true OOP language caused me a problem and frustrations. Mostly that was when delved a bit too deep for my abilities.
    Thankfully , experts here were able to save me from drowning.

    Alan
    '_- Google first, like this _ site:ExcelForum.com Gamut
    Use Code Tags: Highlight code; click on the # icon above,
    Post screenshots COPYABLE to a Spredsheet; NOT IMAGES PLEASE
    http://www.excelforum.com/the-water-...ml#post4109080
    https://app.box.com/s/gjpa8mk8ko4vkwcke3ig2w8z2wkfvrtv
    http://excelmatters.com/excel-forums/ ( Scrolll down to bottom )

  11. #11
    Registered User
    Join Date
    01-03-2014
    Location
    pakistan
    MS-Off Ver
    Excel 2003
    Posts
    10

    Re: difference between VBA and Visual Basic

    It wouldn't surprise me if MS didn't know either yet. I doubt they'll do anything as drastic as the change from XLM to VBA though. VB and VBA have become very useful since their inception. Probably the only thing to halt VB or VBA would be if everyone switched Operating Systems.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Visual Basic bug?
    By mreFF in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-08-2014, 06:07 PM
  2. New to Visual Basic.
    By mcatmull in forum Hello..Introduce yourself
    Replies: 1
    Last Post: 01-24-2014, 08:20 PM
  3. Visual basic Help
    By jrortiz2 in forum Excel General
    Replies: 1
    Last Post: 10-27-2010, 04:53 AM
  4. Visual Basic Help
    By gregory.barrett in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-03-2006, 04:23 AM
  5. [SOLVED] Can I run Visual Basic procedure using Excel Visual Basic editor?
    By john.jacobs71 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-26-2005, 10:25 AM
  6. Replies: 1
    Last Post: 09-13-2005, 07:06 AM
  7. Visual Basic
    By Micos3 in forum Excel General
    Replies: 9
    Last Post: 06-28-2005, 09:06 AM

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