How to show user % complete for time-consuming task?

L

Lloyd Catlett

I've a sub that takes as much as 2 minutes to complete all work and return
control to user. I can easily calculate the % progress and want to display
it (with updates) to let the user know something is really happening.

I created a textbox that I make visible and can change the textbox.value as
the % complete changes. The only way I can get the textbox.value to update
is to do a userform.RePaint, but the flickering of the userform is
distracting.

Any suggestions for another way?
 
P

Paul Shapiro

The system status bar can display a progress meter. Look at details for
SysCmd. A rough sample would be:

'Initialize
SysCmd acSysCmdInitMeter, "Status line text...",
longIntegerValueWhichIs100Percent

'Within your task report status
SysCmd acSysCmdUpdateMeter, longIntegerValueCompleted

'Cleanup when finished
SysCmd acSysCmdRemoveMeter

Many years ago I found that calls to display progress could take more time
than the task itself. If the counter I'm using to estimate status is a very
large number, I include a line to only update the status meter if the
percent complete changes by at least 1%. It could be no longer necessary,
but worth checking that the task doesn't take significantly longer when you
report status.
 
M

Michael Bednarek

I've a sub that takes as much as 2 minutes to complete all work and return
control to user. I can easily calculate the % progress and want to display
it (with updates) to let the user know something is really happening.

I created a textbox that I make visible and can change the textbox.value as
the % complete changes. The only way I can get the textbox.value to update
is to do a userform.RePaint, but the flickering of the userform is
distracting.

Any suggestions for another way?

Have you tried the "Microsoft ProgressBar Control 6.0" from "Microsoft
Windows Common Controls 6.0" (mscomctl.ocx)? I've used that a number of
times. Some instructions at
http://www.la-solutions.co.uk/content/MVBA/MVBA-ProgressBar.htm .
 
L

Lloyd Catlett

Michael, I just took a look at the link you suggested. It looks like it will
provide exactly what I want. I'll try it out in the next day or two and let
you and the others know the results.

If I could bake some cookies for you, I'd do it, but a "Thank you" will
hopefully be enough.
 
L

Lloyd Catlett

I've tried this, but where I define frm as a new frmProgressBar I get error
"user-defined type not defined"; I guess this means I need to add a
reference. If this is my problem, do you know which reference I need to add?
 
M

Michael Bednarek

I've tried this, but where I define frm as a new frmProgressBar I get error
"user-defined type not defined"; I guess this means I need to add a
reference. If this is my problem, do you know which reference I need to add?

As I wrote before, it works here when I add a reference to "Microsoft
Windows Common Controls 6.0" (mscomctl.ocx).
 
M

Michael Bednarek

Unless you had Visual Basic 6.0 or someone distributed mscomctl.ocx
with a VB 6.0 application, or (in violation of the EULA) you
downloaded the file from someplace on the web, you won't have that
file. Read the Overview section of
http://www.microsoft.com/downloads/...98-51D0-41C1-BB14-64662F5F62FE&displaylang=en.

I believe your are incorrect.

One: all our office PCs have mscomctl.ocx, and only 2 have VB installed,
but all have Microsoft Office Professional V-11 installed.

Two: quoting from http://support.microsoft.com/kb/280662 :
"These components (web controls from mscomctl.ocx) are included with the
Microsoft Office Standard Suite and the Microsoft Office Professional
Suite, as well as with Microsoft Access."

Three: In the MSOF11 distribution, there's a file MSCOMCTL.OCX in
ZS561401.CAB and in FILES\ACCRT\ACCESSRT.CAB .

Four: I'm not in the habit of "downloading files from someplace on the
web" and I find that suggestion offensive.

I consider it rude and libellous to accuse correspondents whose record
and reputation in these fora is not difficult to ascertain of such
criminal behaviour.
 
D

Doug Robbins - Word MVP

Jay did not actually accuse you of doing something in violation of a EULA.
That was just one of the ways that he mentioned that it might have been
obtained. There were other legitimate means by which it may have been
installed.

In my case, it appears that the file was installed as part of the Roxio Easy
Media Creator software as it is only in a folder under that application that
it appears.

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP, originally posted via msnews.microsoft.com
 
M

Michael Bednarek

Jay did not actually accuse you of doing something in violation of a EULA.
That was just one of the ways that he mentioned that it might have been
obtained. There were other legitimate means by which it may have been
installed.
[snip]

Quote:
Unless you had Visual Basic 6.0 or someone distributed mscomctl.ocx
with a VB 6.0 application, or (in violation of the EULA) you
downloaded the file from someplace on the web, you won't have that
file.
Jay Freedman. Mon, 26 Apr 2010 22:25:29 -0400

If the above was an incomplete list of legitimate means to obtain
mscomctl.ocx and if the "you" was meant as substitute for the impersonal
pronoun "one", then the post was pointless. I haven't seen any pointless
posts by Jay, so I assume this post also has a point.

In determining the point, I read what was written:
"Unless "VB" or "App" or "illegal": "you won't have that file."
transformed:
"You can only have that file" if "VB" or "App" or "illegal".

I know I don't have "VB" or "App", so I must have the file illegally.

If the point of the post was that Jay wanted to know whether
mscomctl.ocx was present on the OP's (Lloyd Catlett) PC, the post
failed.
 

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