?
Solved

Progress bar

Posted on 2012-03-14
5
Medium Priority
?
254 Views
Last Modified: 2012-03-16
Hi,

I have a user form that performs a few actions, some of these can take a few minutes. I want to show the user that something is happening as the egg timer flicks on and off.

I have previously used user forms to create a progress bar and updated that everytime a module finished. I dont really want to be building multiple user forms to show the progress.

Is there a simple way i cant show that something is happening to the user, then when the sub finished, the signal ends

Thanks
Seamus
0
Comment
Question by:Seamus2626
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 12

Expert Comment

by:kgerb
ID: 37720364
I have used Alain's.  It's attractive and works well.  All the heavy lifting is already done.  You just have to implement it.

Article

Make sure you click 'yes' if you like it and use it.

Kyle
0
 
LVL 10

Expert Comment

by:Mez4343
ID: 37720381
What about using the Status bar in bottom left corner of excel window?

http://www.vbaexpress.com/kb/getarticle.php?kb_id=87
0
 

Author Comment

by:Seamus2626
ID: 37720442
Hey Mez, i would prefer something more visible.

Kyle, i dont understand how thias code will know when my sub has finished its actions?

Thanks
Seamus
0
 
LVL 12

Accepted Solution

by:
kgerb earned 2000 total points
ID: 37720543
Seamus,
You have to configure the progress bar before you use it and tell it how many iterations you are going to run.  Then, while you are looping through your iterations you have to update the status of the progress bar.  

This example is copied directly from the article.
Sub wasteTime()
    Dim i As Long
    Dim diag As New ProgressDialogue
    diag.Configure "Wasting Time", "Now wasting your time...", -10000, 10000
    diag.Show
    For i = -10000 To 10000
        diag.SetValue i
        diag.SetStatus "Now wasting your time... " & i
        If diag.cancelIsPressed Then Exit For
    Next i
    diag.Hide
End Sub

Open in new window

Line 4 configures the progress bar with a title, a comment, a min value, and a max value.
Line 7 updates the progress bar with a new value.

Hope this helps.  If you need more explanation let me know.

Kyle
0
 

Author Closing Comment

by:Seamus2626
ID: 37728823
Thank you Kyle

All good
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Introduction This Article briefly covers methods of calculating the NPV and IRR variants in Excel as well as the limitations in calculating and interpreting IRR results. Paraphrasing Richard Shockley, author of my favourite finance reference tex…
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
Graphs within dashboards are meant to be dynamic, representing data from a period of time that will change each time the dashboard is updated with new data. Rather than update each graph to point to a different set within a static set of data, t…
This Micro Tutorial demonstrates how to create Excel charts: column, area, line, bar, and scatter charts. Formatting tips are provided as well.

764 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