Which is more efficient? Search and Replace or Looping Through AllProject Tasks?

A

andy.novak

During testing, it seems about the same, but generally speaking is it
more efficient or "better" to do a search and replace (within VBA) on
project task contents or loop through each task via VBA and set the
values individually?

Thanks,
Andy Novak
UNT
 
R

Rod Gill

The fastest should be search and replace. If any change causes a
recalculation, then set calculation to manual at the start, then automatic
at the end for more speed.

--

Rod Gill
Microsoft MVP for Project - http://www.project-systems.co.nz

Author of the only book on Project VBA, see: http://www.projectvbabook.com




During testing, it seems about the same, but generally speaking is it
more efficient or "better" to do a search and replace (within VBA) on
project task contents or loop through each task via VBA and set the
values individually?

Thanks,
Andy Novak
UNT

__________ Information from ESET Smart Security, version of virus
signature database 4937 (20100311) __________

The message was checked by ESET Smart Security.

http://www.eset.com

__________ Information from ESET Smart Security, version of virus signature database 4937 (20100311) __________

The message was checked by ESET Smart Security.

http://www.eset.com
 
A

andy.novak

The fastest should be search and replace. If any change causes a
recalculation, then set calculation to manual at the start, then automatic
at the end for more speed.

--

Rod Gill
Microsoft MVP for Project -http://www.project-systems.co.nz

Author of the only book on Project VBA, see:http://www.projectvbabook.com










__________ Information from ESET Smart Security, version of virus signature database 4937 (20100311) __________

The message was checked by ESET Smart Security.

http://www.eset.com

Rod, I'm simply replacing the Status Manager, so I'm guessing no
recalculations there. Thanks!
 
A

andy.novak

Rod, I'm simply replacing the Status Manager, so I'm guessing no
recalculations there.   Thanks!

Rod, generally speaking, say you turn off automatic calculation, then
do the search and replace. If there were recalculations yet to
happen, once you issued the VBA command to turn the automatic recalc
back on (immediately after the search and replace), does the recalc
happen instantly before the following save/close w/checkin
statement(s) or does the recalc happen only when the project is opened
again?
 
J

Jack Dahlgren MVP

This could probably be confirmed with a small test. I think it will recalc,
but I'd issue a specific recalc command.

-Jack
 
R

Rod Gill

I'm pretty sure it would immediately recalculate as on Automatic all
calculations should automatically be up to date.

--

Rod Gill
Microsoft MVP for Project - http://www.project-systems.co.nz

Author of the only book on Project VBA, see: http://www.projectvbabook.com




Jack Dahlgren MVP said:
This could probably be confirmed with a small test. I think it will
recalc, but I'd issue a specific recalc command.

-Jack




__________ Information from ESET Smart Security, version of virus
signature database 4940 (20100312) __________

The message was checked by ESET Smart Security.

http://www.eset.com

__________ Information from ESET Smart Security, version of virus signature database 4940 (20100312) __________

The message was checked by ESET Smart Security.

http://www.eset.com
 
L

Lars Hammarberg

With a large number of tasks I've found it very efficient to create and apply
a filter (using VBA) and then loop through the resulting lines - with a
sufficiently exclusive filter you could end up with just a few lines.
 

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