Performance

S

SonT

Please tell me some of the factors that may affect the performance of my vba
codes. Everytime I run my codes, the time for it to get process takes longer
on certain file. The codes are copied so they are exactly the same. Any
advice is appreciated.

Thank you.
 
J

John

SonT said:
Please tell me some of the factors that may affect the performance of my vba
codes. Everytime I run my codes, the time for it to get process takes longer
on certain file. The codes are copied so they are exactly the same. Any
advice is appreciated.

Thank you.

SonT,
First of all, if the macro is recorded instead of developed manually, it
will be running using foreground processing. Foreground processing is
slower and heavily dependent on the display. Larger files will take
longer to process.

If the macro code was developed to run using background processing,
(manipulate projects objects directly rather than objects via
selection), then the processing time is more dependent on how efficient
the code is written (e.g. efficient loops, operating only on the data
necessary, etc.).

When developing macro code manually, perhaps the most important first
step is to develop an outline of what the code should do. Once the
requirements are well understood, it is much easier to develop efficient
code that meets those requirements and executes in minimum time.

John
Project MVP
 

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