vba included in windows?

D

Danny J

Dear all,

is VBA included with windows and if so how do I find out which version?

Thanks,

Danny
 
S

Steve Rindsberg

is VBA included with windows and if so how do I find out which version?

No, but it's part of each version of MS Office since Office '97.
 
D

Danny J

Thanks Steve,

So if I haveMSOffice 2003 is it possible to just install the VBA and not the
rest? Are the different versions of vba much different to each other?

Danny
 
S

Steve Rindsberg

So if I haveMSOffice 2003 is it possible to just install the VBA and not the

No. One of the differences between VB and VBA is that VBA is "hosted" within
an application. It's part of PowerPoint, Word, Excel, etc, not a standalone.
Are the different versions of vba much different to each other?

Between Office 97 and Office 2000 there are some significant differences, but
generally you can write code that works in either.

Is there some specific problem you're trying to solve?
 
D

Danny J

Not really,

It's more that I am an IT trainer, and though there are some bespoke systems
I need to learn first at some point VBA seems like a good way to progress my
knowledge base.

Danny
 
D

Danny J

So is learning VB very different to VBA? Which is more useful in an MS
Office environment?

Thanks,
Danny
 
S

Steve Rindsberg

Not really,

It's more that I am an IT trainer, and though there are some bespoke systems
I need to learn first at some point VBA seems like a good way to progress my
knowledge base.

In that case, any version of Office from 2000 on will have the same version of
VBA, so install whatever you've got and go to.
 
S

Steve Rindsberg

So is learning VB very different to VBA? Which is more useful in an MS
Office environment?

Think of VBA as VB minus a few features, plus specialized knowledge of the app
it's hosted in.

As far as the no pun intended basics, they're really quite similar. Any effort
spent in learning VB will not go to waste if you need to program in VBA.

Likewise, it's not hugely difficult to control an office app using VB and it's
often simplest to write the code in the office app itself, where you can easily
test little snippets of it at a time, then copy/paste it into VB.

One advantage to VB is that it can make more or less standalone EXE files,
which VBA cannot.
 
H

Howard Kaikow

Steve Rindsberg said:
Think of VBA as VB minus a few features, plus specialized knowledge of the app
it's hosted in.

As far as the no pun intended basics, they're really quite similar. Any effort
spent in learning VB will not go to waste if you need to program in VBA.

It is actually better to learn VB as the books for VB are far superior to
the books for VBA.
For example, Gary Cornell's Visual Basic 6 from the Ground Up.
Likewise, it's not hugely difficult to control an office app using VB and it's
often simplest to write the code in the office app itself, where you can easily
test little snippets of it at a time, then copy/paste it into VB.

One advantage to VB is that it can make more or less standalone EXE files,
which VBA cannot.

More importantly, VBA cannot be protected from prying eyes, but can can
convert the VBA to a VB DLL to protect the code and, usually, improve
execution speed.
 
D

Dave

Howard Kaikow said:
the

It is actually better to learn VB as the books for VB are far superior to
the books for VBA.
For example, Gary Cornell's Visual Basic 6 from the Ground Up.
and

More importantly, VBA cannot be protected from prying eyes, but can can
convert the VBA to a VB DLL to protect the code and, usually, improve
execution speed.

how do you do that? that could be useful for something i am working on now.
 
S

Steve Rindsberg

As far as the no pun intended basics, they're really quite similar. Any
effort

It is actually better to learn VB as the books for VB are far superior to
the books for VBA.
For example, Gary Cornell's Visual Basic 6 from the Ground Up.

True, and there are far more of them, so you can find something for every
taste, ability and learning style.
 
H

Howard Kaikow

how do you do that? that could be useful for something i am working on
now.

It's a two step process.

1. First convert as much of your code as you can to a class within VBA.
2. Once that's working, move the class to VB and compile a DLL.

You then add a reference to the DLL in your VBA project and use the class in
the DLL, deleting the class in the VBA.
Although a bit more work, you can also convert VBA Userforms to VB Forms to
protect th ecode in the forms.
For example, the following is one module from my Normal template, where
WordVBNormal is in a VB 6 DLL:

Option Explicit
Public clsWordVBNormal As WordVBNormal

Public Sub AutoClose()
clsWordVBNormal.AutoClose
End Sub

Public Sub AutoExec()
' Runs only when global
SetupClass
clsWordVBNormal.AutoExec
End Sub

Public Sub AutoExit()
clsWordVBNormal.AutoExit
End Sub

Public Sub AutoNew()
SetupClass
clsWordVBNormal.AutoNew
End Sub

Public Sub AutoOpen()
SetupClass
clsWordVBNormal.AutoOpen
End Sub

Private Sub SetupClass()
Dim docTemp As Word.Document
If clsWordVBNormal Is Nothing Then
If Documents.Count = 0 Then
Set docTemp = Documents.Add(Visible:=vbFalse)
End If
Set clsWordVBNormal = New WordVBNormal
clsWordVBNormal.SetClass Word.Application
If Not (docTemp Is Nothing) Then
docTemp.Close
Set docTemp = Nothing
End If
End If
End Sub
 
D

Dave

ok, that makes sense, but probably not very useful for what i have going...
virtually all the code is form related. will just go with splitting the db
and making it into an mde i think... at least that will keep the users from
mucking with the code.
 

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