Is VBA/Word slow...or is it just the way I did it?

Z

Zokess

I have created what I believe to be a rather complex document/program in word
(I believe there are over 13000 total lines of code). I have quite a few
auto-text entries that either are, or contain graphics. The overall size of
my Word Template (one I created specifically for this purpose, not
Normal.doc) is quite close to 8 Megs. The document doesn't seem like it
takes excessivly long to open, or for the first UserForm to appear as a
reault of the AutoNew Macro which calls the form. It seems like it takes
excessively long for 1) items to be transferred from the userform comboboxes
and text boxes to the FormFields in the template, 2) the userForm to unload,
and 3) the 2nd userform to load. Then it seems to take excessively long for
the same things to occur with the 2nd userform.
 
H

Howard Kaikow

The first step is to clean up the code using tricks such as:

1. Do not use the Variant data type.
2. Do not use the Object data type, unless absolutely necessary.
3. Get rid of all unnecessary object references by using With ... End With.

Making those, and other changes, you may be able to reduce running time by
over 99%.
 
Z

Zokess

Howard, Thanks for the tips...unfortunately, I have already gotten rid of any
Varient data types that I did use, I have not used any object data types and
don't believe I used any onject references. At least not directly...I did
have a few procedures that were too large for Word VBA to handle so I broke
them up into seperate procedures and call them as needed.

Any more advice / help? I appreciate it all!!
 
H

Howard Kaikow

You are always referring to objects within code.

Take a look at the Help for With.
 

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