• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 148
  • Last Modified:

vba word help

I have alot of code behind a word app.  I was wondering if there is a way to speed up my document so it don't run slow.

would the screenupdate and screenrefresh work for this situation?
0
Jason_Kha
Asked:
Jason_Kha
1 Solution
 
thunder_mooseCommented:
Hi there,

I don't think there's any real way we can help you with this, since we can't see the code to help you optimize it. ScreenUpdate and ScreenRefresh only has to do with when the screen updates or refreshes and wouldn't change the execution speed of your program.

If it's running too slowly, it's probably because you have too many redundant loops or other events that are repeated more than needed. You can also sometimes make logical statements go faster by simplifying them, for example:

If Instr(strName) <> 0 Then

Could just be: If Instr(strName) Then

For some tips on optimizing your code, check out this website:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/modcore/html/deconoptimizingvbacode.asp

To be of real help though, we'd have to see the actual code. If you could paste it here, that would be great. If the program is really THAT big though, then maybe you could mail it to one of us to have a look at it, along with a description of what it's supposed to do and why. You can send it to me if you like, at ghandi@mailbox.co.za

Best of luck,
TM
0

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now