Thread: Progress Bar
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
K Dales[_2_] K Dales[_2_] is offline
external usenet poster
 
Posts: 1,163
Default Progress Bar

The status bar can be written to as follows:

Application.StatusBar = "Please wait..."
When done set Application.Statusbar = False to give control back to Excel.

But there is no "plug and play" way to show how much progress you have made
since the status bar text has no way of knowing what your code is doing, or
how close to done it is, without being in some way linked to your code.
Normally, what takes code a long time to run is a loop; so you could update
the bar in your loop to show progress:

For i = 1 to 1000
' Your loop code
Application.StatusBar = "Please wait: " & Format(i/1000,"%##0") & "
complete"
Next i

But how to do this depends on what kind of loops you have in your code and
how you would "measure" progress.

There is also an ActiveX ProgressBar available in the "Other Controls" of
the control toolbox that can be used, but likewise needs to be linked to your
code.
--
- K Dales


"matpj" wrote:


Hi there,

i would very much like to include a progress bar, or use the command
bar status section to display how my macro is doing (so users do not
think the process has crashed)

I have several modules that are run, starting with Module1.

Does anyone have some plug and play code that I can simply copy and
paste, and just insert "Call openfobs()" into?

thanks in advance,
Matt


--
matpj
------------------------------------------------------------------------
matpj's Profile: http://www.excelforum.com/member.php...o&userid=21076
View this thread: http://www.excelforum.com/showthread...hreadid=483556