1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

Solved: Excel Macro - Progress Bar - Not Working

Discussion in 'Business Applications' started by Lightingman2003, Aug 5, 2011.

Thread Status:
Not open for further replies.
  1. Lightingman2003

    Lightingman2003 Thread Starter

    Joined:
    Aug 14, 2007
    Messages:
    119
    Hi.

    I have built a macro that imports Data from another worksheet, and to add to the user experience, I want to add a progress bar.

    I have added the code, and userform to make this happen, however, it wont update (i.e. show me the progress).

    I have tried turning screenupdating on, setting the userforms properties ShowModal=True, and ShowModal=False.

    When the ShowModal is set to true, the user form actually displays, but gets itself into a neverending loop and wont quit.
    When the ShowModal is set to false, all I get is an outline of the form, but the middle of the box is white and works as normal.

    The code is invoked from several different subs as I have different subs that import a different part of the worksheet.

    I am using the following code:

    Progress.Show
    Progress.lblBreakoutNo.Caption = "Currently Importing"
    PctDone = BreakoutNo / NoofClaims 'update Progress bar
    With Progress
    .FrameProgress.Caption = Format(PctDone, "0%")
    .LabelProgress.Width = PctDone * (.FrameProgress.Width - 10)
    End With


    Any help would be appreciated.

    Thanks

    Lightingman2003
     
  2. Lightingman2003

    Lightingman2003 Thread Starter

    Joined:
    Aug 14, 2007
    Messages:
    119
    I have now managed to solve it. It was user error, forgot to add "DoEvents" after the ProgressBar.

    Hope this helps somebody else out though.

    Will now mark as "Solved".

    Thanks

    Lightingman2003
     
As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Loading...
Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/1010833

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice