Hello Charlie,
I created this Progress Bar for VBA. It works with VBA 5.0 (Sp2) an
VBA 6.0. It has a full set of propeerties to allow you to change th
color of the progress bar, and its text. It also has a message panel t
allow you to display information about the progress. The bar is smot
and displays the percent completion in the center. I got tired of no
having a control in VBA to do this, and I am sure you feel the same.
You will need to insert a Class Module into your project and then cop
the code into it. The code is lengthy and complex, but the Progress Ba
is very easy to use. I had to attach the code as a file because it is t
long to display in the given message area.
USING THE PROGRESS BAR FOR VBA
1)[/B] IN THE DECLARATIONS SECTION OF THE USER FORM, ADD TH
FOLLOWING...
PUBLIC PROGRESSBAR1 AS NEW PROGRESSBARVBA
*2)* IN THE USER FORM'S ACTIVATE EVENT ADD...
PROGRESSBAR1.INITIALIZE
*3)* TO DISPLAY THE PROGRESS OF AN OPERATION...
PROGRESSBAR1.PERCENT = X/Y 'WHERE X IS THE LAGER VALUE
*4)* TO DISPLAY A MESSAGE ABOUT THE PROGRESS...
PROGRESSBAR1.MESSAGE = \"WHATEVER YOU TO SAY\"
THIS WILL DISPLAY THE MESSAGE FOR 1/4 OF SECOND. YOU CAN CHANGE TH
AMOUNT OF TIME BY SETTING THE DISPLAYTIME PROPERTY. THE TIME IS I
MILLISECONDS. THIS PAUSES PROGRAM EXECUTION TO DISPLAY THE MESSAGE.
THE PROPERTIES ARE
BarColor - This can be an RGB value or VBColor constant
DisplayTime - Time in milliseconds (1/1000 of second = 1 millisecond
to display a message. Set to zero to make the message static. This wil
not pause the program.
hWnd - Window Handle of the ProgressBar (Used in API calls). Read Only
Message - Any information you want to display to the user.
MessageColor - Change the Font Color of the message. RGB or VBColo
constant
TextColor - Change the Font Color of the Progress Percentage. RGB o
VBColor constant
THE METHODS ARE
Clear - Clears both the Progress Bar Display and the Message Display
ClearMessage
ClearProgressBar
Refresh - Repaints both the ProgressBar and the Message
If you have any problems or need more information, contact me via emai
(e-mail address removed).
Enjoy,
Leith Ros
+-------------------------------------------------------------------
|Filename: ProgressBarVBA.zip
|Download: http://www.excelforum.com/attachment.php?postid=3936
+-------------------------------------------------------------------