Solved

Status bar

Posted on 2001-09-15
4
239 Views
Last Modified: 2010-05-02
Hi,

How to write a pie of code that show the status bar (blue color) in VB like when we downloading the file from internet?

My scenario is every time when user click on the Export Button, the program will extract the data from database (about 4000 records) and then write to excel.

I would like to add the status bar to show the user how many percentage being process....and after finished processing, then pop the message box to tell the user that process is completed. My point is to show the user that the program is processing the data and is not hang!


Can anyone show me some working code?

Thanks.

0
Comment
Question by:ht055
[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
4 Comments
 
LVL 44

Accepted Solution

by:
bruintje earned 50 total points
ID: 6484516
Hi hto55, you could use the progress bar control as supplied by Microsoft is in Microsoft Windows Common controls 6 in the project>components section of VB- depending on what version you have I think.

another option is using this code from MVP Jonathon West to simulate a progress bar in Word

The procedures are as follows, and assume that the progress bar has a Width of 200, and that the lower control is called ProgressBar and the upper one is ProgressBarText.

Private lngPercent As Long

Property Let PercentComplete(Percent As Long)
If Percent < 0 Then
    lngPercent = 0
ElseIf Percent > 100 Then
    lngPercent = 100
Else
    lngPercent = Percent
End If
ProgressBarText.Caption = CStr(lngPercent) & "%"
ProgressBar.Width = 2 * lngPercent
End Property

Property Get PercentComplete() As Long
PercentComplete = lgnPercent
End Property

HTH:O)Bruintje
0
 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 6485420
Hearing...
0
 

Author Comment

by:ht055
ID: 6489173
Hi,

Do i have to put the record count? So the status bar will display 100% once is enf of last record?
0
 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 6496677
bruintje, i just understood your thinking!
Cheers
0

Featured Post

Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

Question has a verified solution.

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

This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

696 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