Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1084423
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T22:33:36+00:00 2026-05-16T22:33:36+00:00

My Excel tool performs a long task, and I’m trying to be kind to

  • 0

My Excel tool performs a long task, and I’m trying to be kind to the user by providing a progress report in the status bar, or in some cell in the sheet, as shown below. But the screen doesn’t refresh, or stops refreshing at some point (e.g. 33%). The task eventually completes but the progress bar is useless.

What can I do to force a screen update?

For i=1 to imax ' imax is usually 30 or so
    fractionDone=cdbl(i)/cdbl(imax)
    Application.StatusBar = Format(fractionDone, "0%") & "done..."
    ' or, alternatively:
    ' statusRange.value = Format(fractionDone, "0%") & "done..."

    ' Some code.......

Next i

I’m using Excel 2003.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T22:33:36+00:00Added an answer on May 16, 2026 at 10:33 pm

    Add a DoEvents function inside the loop, see below.

    You may also want to ensure that the Status bar is visible to the user and reset it when your code completes.

    Sub ProgressMeter()
    
    Dim booStatusBarState As Boolean
    Dim iMax As Integer
    Dim i As Integer
    
    iMax = 10000
    
        Application.ScreenUpdating = False
    ''//Turn off screen updating
    
        booStatusBarState = Application.DisplayStatusBar
    ''//Get the statusbar display setting
    
        Application.DisplayStatusBar = True
    ''//Make sure that the statusbar is visible
    
        For i = 1 To iMax ''// imax is usually 30 or so
            fractionDone = CDbl(i) / CDbl(iMax)
            Application.StatusBar = Format(fractionDone, "0%") & " done..."
            ''// or, alternatively:
            ''// statusRange.value = Format(fractionDone, "0%") & " done..."
            ''// Some code.......
    
            DoEvents
            ''//Yield Control
    
        Next i
    
        Application.DisplayStatusBar = booStatusBarState
    ''//Reset Status bar display setting
    
        Application.StatusBar = False
    ''//Return control of the Status bar to Excel
    
        Application.ScreenUpdating = True
    ''//Turn on screen updating
    
    End Sub
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an Excel VBA tool which needs to query Oracle. I am using
I am writing a reporting tool to document Excel files for various compliance criteria,
I'm writing a tool that syncs a simple database with Excel sheets. Each item
I have created a tool that imports an excel sheet. The excel COM object
We are branching out beyond the development team and trying to get other groups
I'm working on a small project that requires some of our users to be
About a year ago we are developed for internal use inprocess MOLAP engine that
Suppose you have an database with the largest tables containing about 200.000 rows, and
I'd like to experiment with burn-down and planning game with the team I'm on.
For example, I want the contents of A1 and B1 to always add up

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.