Size of project - VBA vs VB

I

Ian B

Hi All

We have a project (Word 2000) with 3,500 lines of code. This interacts with
a later developed VB6 routine with 2000 lines of code
Most of the code involves file & word manipulation including 25 forms.
We intend to revise and combine the routines (Word 2003) and so finally to
my questions:

Is there a practical limit to the size of a VBA routine in Word?
Which choice would be the preferred?
1. Do all code in VBA
2. Do all code in VB (6)
3. Do top level in VB and call VBA subroutines imbedded in Word (bit
like stored proceedures)
4. Do top level code in VBA and call VB6 exe's.

Any advice welcomed

TIA

Ian B
 
J

Jezebel

I've been involved with projects that went both ways on this. From a
performance point of view, it doesn't make a lot of difference (for most
purposes, anyway). The big issues are convenience of maintenance and
installation.

1. Development and debugging is *much* easier if all the code is in the one
place. Most large apps have common elements like utility functions, global
constants, etc -- you end up having to duplicate these if you split your app
between VB and VBA (as opposed to multiple VB components with shared
modules). Error-handling is also a lot trickier.

2. Debugging is hell on wheels if you have to bounce back and forth between
VB and VBA. Inevitably you end up with faults that mean you have to restart
everything and you're left wondering which end caused the crash.

3. Having a large amount of code in VBA is better avoided: it makes Word
slower to load (every time, if your code is in an add-in); and the template
containing the code tends to get corrupted with annoying regularity.

4. You'll have more work to do when you issue updates: you're likely to have
to update both the Word and VB components, and ensure mutual compatability
(which isn't necessarily a problem, but can be).


So if it were me, I'd put all the functional code into VB. Use VBA *only*
for the Word user interface elements (menus, hotkeys, etc) and to relay
instructions to the VB app.
 
I

Ian B

Jezebel

Thankyou for your comments & suggestion.
We will take your advice and do the project in VB6.

Regards

Ian B
 

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