Solved

ProgressBar While Waiting For Word Macro

Posted on 2002-05-15
3
218 Views
Last Modified: 2008-03-10
I'm using VB6 against an SQL Server database.
I have a form which has several selections and a command button which the user launches a word macro based on these selections.
The word macro will launch an instance of Microsoft Word and generate a report based on the user selections.
Sometimes if the report is large, it takes a while for Word to popup.
I added a "Processing...Please Wait...." to the Caption to inform the user.
I'd like to add a ProgressBar to let them know that word is busy in the background.
I don't have a recordset to loop thru so I can't show them the progressbar processing on the from so is there another way to do this; possibly with a timer.

Also, if anyone knows of other ways to inform the user of a wait state, I'd appreciate it.

Thanks in Advance
John
0
Comment
Question by:jtrapat1
  • 2
3 Comments
 
LVL 4

Accepted Solution

by:
trkcorp earned 50 total points
ID: 7011403
Just a suggestion... you might opt for a status bar and simply change the text as you go through the motions.  For example:
"Initializing Microsoft Word.  One moment please..."
"Opening Word document."
"Processing Macro.  One moment please..."
"Macro completed.  Closing Word.  One moment please..."
"Process completed successfully!"

This kind of approach works pretty well.  A progress bar could be used too by counting the steps involved, setting the .Max property = to the count and then incrementing the value as each step completes.
0
 
LVL 69

Expert Comment

by:Éric Moreau
ID: 7011548
because Word does not trigger events when running a macro, you cannot have a progress bar (you don't know for how long the macro will run and how much time for ending).
0
 
LVL 4

Expert Comment

by:trkcorp
ID: 7011579
emoreau is right and so all you can do is report to the best of your knowledge what is taking place according to your code's execution... anything else would just be some "made up stuff".
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

937 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now