VBA or Visual Basic?

S

Sam Lewis

Greetings all,

I have been told that VBA is mainly for use within Word or other
applications. I have access to material to learn Visual Basic and was
wondering whether I should put my efforts into this with the presumption
that if I learn Visual Basic it would supersede the need to learn VBA? I'm
not sure how the different learning curves compare.

Thanks in advance,

Sam
 
A

Anand.V.V.N

Hi Sam,

I had learnt Visual Basic first, as a mtetr of fact still learning. If you
learn Visual Basic you can, you can apply the same coding methods and
concepts in VBA too, the visual basic editor in word etc, are almost the same
except for few things. One major advantage of learning VB is that you can
atomate wor, and other office application using VB code rather than using
VBA, and ofcurse by learning VB you can get into windows programming,
database programming etc. If you learnt VB, the same concepts as in coding
style etc work for VBA. There are not much difference between VB and VBA that
you would wirite within word and other office applications though.

Any way from my experience I am saying that learning Visual Basic does help
a lot, which you can directly apply to what you write within word etc. One
more thing is that there is a concept called User Form, which is very easy to
undestand if you know Visual Basic.

Hope you find it useful, let me know if you need any more information

Anand
 
E

Ed

All this depends on whether you're going to learn VB Classic or VB.NET,
which are two different animals. Closely related, yes, but different enough
to be frustrating!

VBA is based in VB Classic, and is the language used by the programs to
record and execute macros. Within these macros, you have great
flexibility - I can and have manipulated Excel from Word macros and Word
from Excel macros.

The deciding factor might be if you need to create a stand-alone executable
that can go onto other machines. Macros tend to work best on the user's
machine, although you can go across servers and networks, but they work
within the Office programs. VB applications, on the other hand, are
self-contained, independent of any other application, and have uses far
beyond a single program.

It's actually very good to know both. I had a spreadsheet with reports I
created on my machine using Word and Excel macros. I tried to post it to
the network using a macro-laden Excel template, but ran into too many
conflicts, so I created a VB app to contain it. The other day, I spent
about an hour creating a Word macro that saved me a day's work piddling with
charts and tables.

Ed
 
H

Howard Kaikow

Yes, but VB 6 facilitates the creation of DLLs, which makes code run faster
and protects the code from prying eyes. Not to mention offering capabilities
not available if using VBA directly.

You can Automate Office apps from VB 6 at least as easily as one can do so
in VBA.
 
S

Sam Lewis

Thanks Anand for the info., very helpful
Sam
Anand.V.V.N said:
Hi Sam,

I had learnt Visual Basic first, as a mtetr of fact still learning. If you
learn Visual Basic you can, you can apply the same coding methods and
concepts in VBA too, the visual basic editor in word etc, are almost the
same
except for few things. One major advantage of learning VB is that you can
atomate wor, and other office application using VB code rather than using
VBA, and ofcurse by learning VB you can get into windows programming,
database programming etc. If you learnt VB, the same concepts as in coding
style etc work for VBA. There are not much difference between VB and VBA
that
you would wirite within word and other office applications though.

Any way from my experience I am saying that learning Visual Basic does
help
a lot, which you can directly apply to what you write within word etc. One
more thing is that there is a concept called User Form, which is very easy
to
undestand if you know Visual Basic.

Hope you find it useful, let me know if you need any more information

Anand
 
S

Sam Lewis

Thanks Ed

I don't know the difference between VB.NET and classic VB but presume from
what you are saying that VB Classic is the way to go.

Sam
 
S

Sam Lewis

Thanks Howard
You can Automate Office apps from VB 6 at least as easily as one can do so
in VBA.

It seems there are overwhelming advantages to learning VB6 (Classic?).Is VBA
only used for writing application specific (and generally less transferable)
macros to automate apps,like for example in Word,and therefore less
complicated?I imagine there is also more "support" supplied within Word's
help section to deal with VBA.The downside of learning VB6 is presumably
that it is more complicated with longer learning curve?

Sam
 
H

Howard Kaikow

Sam Lewis said:
It seems there are overwhelming advantages to learning VB6 (Classic?).Is VBA
only used for writing application specific (and generally less transferable)
macros to automate apps,like for example in Word,and therefore less
complicated?I imagine there is also more "support" supplied within Word's
help section to deal with VBA.

Whatever language you use, be it VB 6 or VB .NET, the language for ALL the
Office apps is still VBA, which is based on VB 6, for Office 2000 and
later, VB 5 for Office 97.

VBA is not a standalone lanuage, it requires a host, such as an Office app.

The "core" of VBA is sort of a subset of VB 6. Indeed, VB 6 sometimes uses
the term VBA to refer to that core.
On top of that VBA core, each Office app has an application specific object
model for VBA is used to program.

The key is to learn the concepts andf you'll, in due course, soon understand
VBA once you know VB 6.

The downside of learning VB6 is presumably
that it is more complicated with longer learning curve?

Not really.

The core of VB 6 is just about the same as VBA.

VB 6 uses a different Forms engine that the Userforms used by VBA, but they
are, largely compatible.
There are some good VB 6 books from which to learn.
One way to start is with the MSFT Press Step By Step book for VB 6.
And a book such as Gary Cornell's Visual Basic 6 from the Ground Up.
 
H

Howard Kaikow

Sam Lewis said:
Thanks Howard.
I presume VB6 is the latest version of VB Classic?

Yes, and unless MSFT changes its mind, VB 6 is the last version of VB
classic.
 
A

Anand.V.V.N

Hi Sam,

You welcome, need any thing else do post it. One more thing just wanted to
say is once you done VB you can pick up .net also very easly that's no
problem.

Anand
 
S

Sam Lewis

Excellent explanation,thanks again for help
Sam
Howard Kaikow said:
Whatever language you use, be it VB 6 or VB .NET, the language for ALL the
Office apps is still VBA, which is based on VB 6, for Office 2000 and
later, VB 5 for Office 97.

VBA is not a standalone lanuage, it requires a host, such as an Office
app.

The "core" of VBA is sort of a subset of VB 6. Indeed, VB 6 sometimes uses
the term VBA to refer to that core.
On top of that VBA core, each Office app has an application specific
object
model for VBA is used to program.

The key is to learn the concepts andf you'll, in due course, soon
understand
VBA once you know VB 6.



Not really.

The core of VB 6 is just about the same as VBA.

VB 6 uses a different Forms engine that the Userforms used by VBA, but
they
are, largely compatible.
There are some good VB 6 books from which to learn.
One way to start is with the MSFT Press Step By Step book for VB 6.
And a book such as Gary Cornell's Visual Basic 6 from the Ground Up.
 
S

Sam Lewis

Okay and thanks again
btw is there a newsgroup for VB6? I found
microsoft.public.vb.general.discussion.There is also one on "vbscript" but
on quick superficial inspection this seems to be dedicated to use of vb in
windows?
Sam
 
A

Anand.V.V.N

Hi Sam,

There is a Visual Basic Group too I think you might have found it , but any
way its Visual Tools and Languages-> Visual Basic. Vb script is mainly used
for internet programing, but the concept is smiliar, and few things differ
though, I am not so sure about vbscript but this link should be helpful to
learn vbscript

http://www.w3schools.com/vbscript/default.asp

And there is anther useful site for learning Visual Basic is

http://www.tutorialized.com/tutorial/Getting-Started-With-Visual-Basic-6.0/4343

Hope you find them useful.

Anand
 
S

Sam Lewis

Thank You Anand
Sam

Anand.V.V.N said:
Hi Sam,

There is a Visual Basic Group too I think you might have found it , but
any
way its Visual Tools and Languages-> Visual Basic. Vb script is mainly
used
for internet programing, but the concept is smiliar, and few things differ
though, I am not so sure about vbscript but this link should be helpful to
learn vbscript

http://www.w3schools.com/vbscript/default.asp

And there is anther useful site for learning Visual Basic is

http://www.tutorialized.com/tutorial/Getting-Started-With-Visual-Basic-6.0/4343

Hope you find them useful.

Anand
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top