Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

May I use the micosoft visual studio net 2003 to do vba

Status
Not open for further replies.

hongma

Programmer
Jun 15, 2006
3
US
I need use the VBA to do a project. I am new for VBA. I wonder if I am able to use the visual studio net 2003 to do vba? if can. How. if not, how to set up a environment? Thanks.
 
VBA stands for Visual Basic for Application, so the developpment environment is the application's VBE.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
visual studio net 2003 has environment for vb.
 
visual studio net 2003 has environment for vb.
Precisely. VB. Not VBA. Seems pretty clear. VBA is an Application environment.

You work with VBA within an application environment. You want to do stuff in Word using VBA - you need the Word environment. Yes, you certainly can WRITE stuff in VB that will action things in Word (or Excel, or Access, or ...). However, to do so the VB code must create the application environment - ie. an instance of Word (or Excel, or Access, or ...).

So you can write code, in VB, that creates the application environment, and then uses that application environment (VBA) to do what you want.

Or you can use the application environment itself. Open an application, go into the VBE - which is similar to the editor in VB (but not exactly), and write your code. Opening any application VBE puts you in the environment. There is no "set up" really. Just open an application VBE and you are there.

Gerry
 
There is another twist though. VBA basically is used to do things inside EXCEL, ACCESS, WORD, and so on.

You can use Visual Studio .Net 2003 to code things for OFFICE by attaching various OFFICE DLLs to .NET project. It will not be VBA in the narrow sence of programming inside the OFFICE applications but you will program all things for OFFICE in .NET. The latter is usually preferable due to the versioning and other aspects.

vladk
 
vladk said:
..The latter is usually preferable..
That's a stiff bite to chew. I'd say the margin is rather slim for using .NET as compared to native VBA. When needed/wanted, it is very applicable though, just not most of the time. :)

-----------
Regards,
Zack Barresse
 
I don't. VB.NET also has better libraries and much more superior object/class model. As such, it is easier to use than VBA. And at some point of time we will find it inside Office, some of us unprepared.
 
I agree that VB.NET has superior a object/class model. I don't agree that this necessarily means it is easier to use. What is easier to use depends on what the programmer has the most experience with.

I'm also not at all convinced that we will find it in Office in the foreseeable future. Even if we do I'm sure Office will still ship with the VBA libraries (for backwards compatibility at least).

Ed Metcalfe.

Please do not feed the trolls.....
 
With the current situation it all depends on precisely what the requirements are for the particular circumstance. If the circumstance requires all the actions within an specific application then it seems to be that VBA would be better - at least for now. We do not know what the project involves, or what it needs. Until those details are expressed - if they ever are - then generally speaking - VBA seems appropriate.

Gerry
 
fumei,

I agree completely.

Ed Metcalfe.

Please do not feed the trolls.....
 
Hi guys,

It all reminds me discussions about the bright future of Algol and Fortran - the laguages that were extremely easy to learn and to use, and they ruled the word.

Where they are?

vladk
 
[lol] Believe it or not, we still have chunks of Fortran code buried away in our system. And yes, at one time
they ruled the word.
for sure. And the word was....aaaaaaaaaaaaarrrrrrrggggggggggggghhhhhhhhhh!

[lol]

At one time we all needed to use machine code too. Ahh, the good old days.

However, I do not think we are arguing anything vis-a-vis for/against. Nor anything regarding "better" (not really). The point, IMHO, is a realistic use of appropriate tools. Again, we do not know anything at all regarding the project in mind. But IF (for example) it is all actions in Word, dealing with Word stuff...then I come down strongly on the side that uses Word stuff. And that is - flatly - VBA. Word does not use VB (.Net or otherwise). It uses VBA. So if all the project is about stuff in Word, 'tis a no-brainer as far as I can see.

I have to say I find it extremely ironic that VB - the program itself, not its results - is......done with VBA.

Gerry
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top