Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Status bar

Posted on 2001-09-15
4
Medium Priority
?
243 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 200 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
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…
Suggested Courses

604 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