PDA

View Full Version : Solved: How to have Userform / MsgBox stay on screen while macros run



mvesaas
08-12-2005, 07:29 AM
:hi: I have a large project that runs through 2-3 mins of macros, mail merge, and formatting. I would like to have a message box (ie userform, msgbox, etc.) appear on the screen to tell the user:

"Please Wait.....Document processing" :whistle:

Ideally, I would like this message box to stay on the screen until the document has been fully processed. (I have a macro that asks the user to SAVE once completed already)

HELP: Is there anyway to make a message box or userform stay on the screen while other macros process? :wot

Killian
08-12-2005, 07:55 AM
Hi there,

Add a userform to your project and call the marcos from there, and a "Save" command button that's disabled until the marco's are all complete. The save code can then be called from the button click.
If you're feeling extravagant, a progress bar would be nice too

I've attached a (very) basic example

mvesaas
08-12-2005, 08:50 AM
:hi: Okay, thanks for getting back to quickly!

So I think I have a basic understanding of the processing userform in your attachment........but when you say "call your macros from there," could you show me a specific example?

I have a lot of IF wording in my macros. Where the code "splits" to go one way or the other, then comes back together, then splits again, etc. Depending on various factors.

Can I still call all the macros form the Userform?

I am attaching your doc, but have added the first few lines of my code that I want to run once the Processing Userform appears.....:wot

Killian
08-12-2005, 10:11 AM
Effectively, all you are doing is calling the macros when the form loads, rather than calling them by using the Tools>Marcos>Run dialog in Word.
It doesn't matter if the code "splits" off to other routines - if you run "IFWar" from the form Activate event, it will run, go off to the other routines (DeleteWar, IFTer1, etc) as you would expect, and when the IFWar routine is complete, the next line in the form Activate code will run.

mvesaas
08-12-2005, 10:25 AM
Okay, I see what you are saying.

One question though, what makes the Userform as soon as the file is opened? The _Activate notation?

The way my doc is set up, it already has an AUTONEW message that pops up, then, an informational Userform pops up, for the user to FILL IN. Then, I want to run the "processing" message to stay up once the program starts running.

Okay - IT IS WORKING. I just figured it out! Okay, I will try to fill in my code and see it that works.

Sorry for all the questions, I am self-taught in VBA, so there def a learning curve. Thanks for your help! :*)

MOS MASTER
08-12-2005, 02:05 PM
Hi M, :yes

Glad to see you've found your sollution.

Don't forget to mark your thread solved? :whistle:

xCav8r
08-12-2005, 02:08 PM
hey, a fellow Minnesotan. Welcome!

MOS MASTER
08-12-2005, 02:18 PM
hey, a fellow Minnesotan. Welcome!

Marco...your new Avatar is GREAT!~ :rofl: