Solved

Progress bar

Posted on 2012-03-14
5
247 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
  • 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 500 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

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

This tutorial explains how to create a series of drop-down lists that are dependent upon prior selections to guide (“force”) the user to make the correct selection and reduce data errors within Microsoft Excel. Excel 2010 was used for this tutorial;…
Some code to ensure data integrity when using macros within Excel. Also included code that helps secure your data within an Excel workbook.
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
This Micro Tutorial demonstrates in Microsoft Excel how to consolidate your marketing data by creating an interactive charts using form controls. This creates cool drop-downs for viewers of your chart to choose from.

912 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

23 Experts available now in Live!

Get 1:1 Help Now