Solved

Progress bar

Posted on 2012-03-14
5
252 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 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

How to quickly and accurately populate Word documents with Excel data, charts and images (including Automated Bookmark generation) David Miller (dlmille) Synopsis In this article you’ll learn how to use ExcelToWord! to copy data,charts, shapes …
In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
The viewer will learn how to create two correlated normally distributed random variables in Excel, use a normal distribution to simulate the return on different levels of investment in each of the two funds over a period of ten years, and, create a …
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…

717 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