VBA changes in Word 2003?

R

Rick Charnes

We have a number of Word macros executed by our PowerBuilder application
that have been running fine for years. These macros were written in
Word Basic, and I'm guessing Word dynamically converts them to VBA as
they're loaded. Powerbuilder loads Word and executes the macro with
OLE.

We've upgraded to Word 2003, and we're now getting intermittent lock-
ups: the macro completes but afterwards the users find that both Word
and the Powerbuilder app have completely frozen. Worse still, we can't
find any pattern to the intermittency. It's agonizingly erratic.

Have there been changes in the way Office 2003 executes VBA code that
might be causing this problem? Thanks for any help.
 
H

Howard Kaikow

Only step by step analysis will isolate the problems, there no general
answers for this type of problem.

Word only partially converts WordBasic to VBA, much of the code may still be
run via the WordBasic object, which does not always produce the same
behavior as in WordBasic.

Not to mention, but I will anyway, VBA is less forgiving than WordBasic. I
got caught once where I was using WB in an undocumented manner and VBA was
happy with that.

To avoid continuing problems, you may wish to convert all.part of the code
to (almost) pure VBA.
See http://www.standards.com/index.html?WordBasic2VBA.
 
H

Howard Kaikow

Rick Charnes said:
Thanks. Does a conversion utility exist to convert to VBA?

No.

When a Word6/7 template is import into Word 97, or later, Word autmatically
"converts" the code, but much of the code remains unconverted, e.g. Dialogs
are not converted to Userforms, but the code is largely untouched as
automatic conversion is not at all practical.

You can examine the code to see how many WordBasic objects are used, instead
of real VBA.

In general, unless the code is absolutely trivial, most WordBasic macros
require a significant rewrite, requiring significant expertise. It is much
easier to maintain/enhance VBA than working via the WordBasic object.
 

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