Moving away from VBA - where next?

A

Adeybaby

Hi

The organisation I work for, a law firm, is looking to move to Office
2007. We have a suite of Word templates built in the conventional VBA
sense (using global and local templates, with a couple of COM addins).
We've been doing this for some time now and are aware that we can
simply run these templates under 2007 with a little fudging but it
doesn't seem to be the right solution going forward. I've heard about
using .NET and VSTO, utilising servers more and XML, but to be honest,
the waters are a bit muddy and I want a place to start. I'd love to
centralise our code, utilise new features and streamline the
operation. So, what do other people do? Where does the code live? What
ends up on the user's PC? I don't want to still be using VBA in 2
years time - I want to be a .NET developer!

Thanks
Ade
 
J

Jonathan West

Adeybaby said:
Hi

The organisation I work for, a law firm, is looking to move to Office
2007. We have a suite of Word templates built in the conventional VBA
sense (using global and local templates, with a couple of COM addins).
We've been doing this for some time now and are aware that we can
simply run these templates under 2007 with a little fudging but it
doesn't seem to be the right solution going forward.

I would be inclined to base a decision on far more than a vague sense that
it "doesn't seem to be the right solution going forward". It may be that all
you need do is modify the user interface for your templates so that they
make use of a customized ribbon instead of custom toolbars. Office 2007
still supports VBA, and VBA gives full access to the Word object model and
(with the use of Microsoft-supplied libraries) full control over XML files.
I've heard about
using .NET and VSTO, utilising servers more and XML, but to be honest,
the waters are a bit muddy and I want a place to start. I'd love to
centralise our code, utilise new features and streamline the
operation.

All that can be done now with VBA. When I attended the MVP Summit when
Office 2007 was at pre-beta stage, the speakers at all the technical
sessions on automation and XML went to great lengths to make it clear that
just about anything you wanted to do with VSTO could also be done with VBA.
So, what do other people do? Where does the code live? What
ends up on the user's PC? I don't want to still be using VBA in 2
years time

Why not? VBA isn't going anywhere soon. For Microsoft to drop VBA in a
future version of office would mean that no organisation that has made a
substantial investment in VBA code (such as yours) coud upgrade to the new
version of Office unless and until all that VBA is rewritten in the
replacement language. That will delay - perhaps permanently - the decision
of many corporate customers to upgrade, and put a severe dent in Microsoft's
revenues. About a third of Microsoft's total revenue is from sales of
Office, and the corporate market is by far the largest part of that third.
It would be financial suicide for Microsoft fo kiss goodbye to that revenue
stream.
- I want to be a .NET developer!

In that case, learn .NET and get yourself a job with a company that is
developing .NET applications. But don't force your existing employer into an
expensive rewrite of all your existing applications simply in order to
indulge that wish. That would be a severe disservice to your employer.

What we have here is your perfectly natural desire to get an opportunity to
play with the latest technology, coming up against the financial interest of
your employer not to spend money on your salary while you do so on company
time rewriting existing applications in .NET before you can even start
adding new features.

If you are going to experiment with the new technology, and want to be able
to do so on company time, then you should get the company's agreement that
you will spend time researching the various alternatives and that they
should not expect specific outcomes from such research. If they agree to
that, then fine. if they don't, then you'll have to have fun with the new
technology in your own time.


--
Regards
Jonathan West - Word MVP
www.intelligentdocuments.co.uk
Please reply to the newsgroup
Keep your VBA code safe, sign the ClassicVB petition www.classicvb.org
 
C

Cindy M.

Hi Adeybaby,
The organisation I work for, a law firm, is looking to move to Office
2007. We have a suite of Word templates built in the conventional VBA
sense (using global and local templates, with a couple of COM addins).
We've been doing this for some time now and are aware that we can
simply run these templates under 2007 with a little fudging but it
doesn't seem to be the right solution going forward. I've heard about
using .NET and VSTO, utilising servers more and XML, but to be honest,
the waters are a bit muddy and I want a place to start. I'd love to
centralise our code, utilise new features and streamline the
operation. So, what do other people do? Where does the code live? What
ends up on the user's PC? I don't want to still be using VBA in 2
years time - I want to be a .NET developer!
I pretty much agree with Jonathan's analysis...

You need to consider a project and the requirements as a whole, then
make a decision. .NET is worth considering if you need things that .NET
uniquely provides. Examples of such things would be
- your company wants to use the .NET Framework security model

- your project requires resources VBA doesn't provide "natively",
but Visual Studio does. Further, a lot of the processing occurs using
these resources (rather than manipulating the Office object models) so
you'd have a considerable increase in efficiency by running in the .NET
Framework instead of in COM

- your project is targeted at multiple platforms, all of which
support the .NET Framework (not likely, when Office is involved)

Fact is, as long as Office remains COM and most of your code manipulate
Office applications, it's going to be more efficient in all respects to
leave that code in VBA. Automating Office from classic VB means going
over one automation interface; doing it from .NET means going over TWO.
In addition, deploying is a LOT more hassle than with VBA embedded in
Office files.

What you might want to consider, if you want to consume .NET
functionality in Office, would be to provide managed code COM dlls. Your
VBA project could call functions, just as with any non-Office dll.
Consider each task your Office projects do and analyze whether it would
be more efficient to use the .NET Framework's capabilities. This
approach will also let various Office apps share common functionality
(if you have that requirement).

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question
or reply in the newsgroup and not by e-mail :)
 
S

Sir Joe

Hi Ade,
sorry for abusing your question, but:

Cindy Meister and Jonathan West, please read my PowerPoint question "Macro
changing the pen width and the pen color". I'm sure, you know the solution!
Please give me a hint.

Sir Joe

NB. I am not a professional developer, I only have Windows XP Tablet
edition, Office 2003 with VBA 6.0 and I downloaded Visual Basic 2005 express
edition.
 
J

Jonathan West

Hi Sir Joe,

I don't see any question with that title in this group. In any case, a
question about PowerPoint is probably best directed to the PowerPoint
experts in microsoft.public.powerpoint. Cindy and I both deal primarily with
Word, and so are less likely to be able to help.

--
Regards
Jonathan West - Word MVP
www.intelligentdocuments.co.uk
Please reply to the newsgroup
Keep your VBA code safe, sign the ClassicVB petition www.classicvb.org
 

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