How can I get a display while VBA is working

H

horst

Hi,
I have a prog working with Word (and a similar one in Corel Draw) which
is quite slow.
Therefore I would like to have a text on the UserForm which slowly
changes from 0 to 100 in order to show the job progress.
But what I get is just a fixed 0 which becomes 100 at the end of the
job. Probably because the display has the lowest priority.
How can I force VBA to show each number during the job?
I didn't find any WAIT or PAUSE or similar instruction.
Any suggestions?
Horst
 
M

Mark Durrenberger

This is an MS Project group. However, I suspect what you need in your VBA is
a "do events" call somewhere in your loop.

You might also consider a progress bar.

Mark


--
_________________________________________________________
Mark Durrenberger, PMP
Principal, Oak Associates, Inc, www.oakinc.com
"Advancing the Theory and Practice of Project Management"
________________________________________________________

The nicest thing about NOT planning is that failure
comes as a complete surprise and is not preceded by
a period of worry and depression.

- Sir John Harvey-Jones
 
R

Rod Gill

Hi,

Don't expect a smooth count. Try single stepping thru your code to see what
happens, you can use the Timer function to time how long each section takes.
Some methods will take much longer than others and control won't return to
your code until it finishes. There are also extra activex controls you can
get that display progress bars, but even so they will only update when your
code calls them, so same problem.

--
For VBA posts, please use the public.project.developer group.
For any version of Project use public.project
For any version of Project Server use public. project.server

Rod Gill
Project MVP
For Microsoft Project companion projects, best practices and Project VBA
development services
visit www.projectlearning.com/
 

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