Solved

ProgressBar While Waiting For Word Macro

Posted on 2002-05-15
3
217 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

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

760 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

21 Experts available now in Live!

Get 1:1 Help Now