How do you display a progress bar to user?

J

Jim Parker

I have created a fairly simple macro that will take quite a long time to
run. What I'd like to do is present something on the order of a progress
bar so that the user has some warm fuzzy that the macro isn't simply
hung. Is there a way to do this in VBA for a Word document (Word 97+)?

This progress bar would not necessarily have to be a grahic. It could be
text. Something like "Working on item x of 20 items" where the macro
updates x as it loops through the items.

I don't want to use MsgBox because that requires user to respond.

Thanks
Jim
 
J

Jezebel

You can put text in the StatusBar. Or display a UserForm with a progressbar
(or whatever you like) on it.
 
J

Jim Parker

StatusBar works for the most part. During first phase of macro, it works
great. During second phase, Word is overwriting the StatusBar itself so
quickly that I can't see what my macro is putting there. But then during
the second phase the document is scrolling down so the user can judge by
that that the macro is making progress.

If I want to get more elegant than that I'll just have to break down and
get a book on VBA and learn about UserForms:)

Thanks
Jim
 
J

Jezebel

UserForms have the additional advantage that you can provide the ability to
interrupt the macro while it's running (which might or might not be a good
thing ...)
 

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