ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Updated Modeless Progress Bar Class Available (https://www.excelbanter.com/excel-programming/277235-updated-modeless-progress-bar-class-available.html)

Robin Hammond

Updated Modeless Progress Bar Class Available
 
If anyone is interested, following up on a previous post there's an updated
version of a progress bar class up on my site. The updates now allow it to
run in Excel 97 as well as later versions (by using the status bar rather
than a modeless form if needed) meaning that the developer doesn't have to
worry about anything other than 95 users. The demo also shows how to handle
a cancel during execution of a routine.

In brief, it displays the usual progress bar, a form title, up to three
captions, and an optional cancel button. Typical usage is shown below.
Hopefully it will help somebody...
Robin Hammond
www.enhanceddatasystems.com
Check out our XspandXL add-in


Public UserCancelled As Boolean

Sub ProgBarDemo()
Dim PB As clsProgBar
Dim nCounter As Integer
Dim lWaitCount As Long

Set PB = New clsProgBar
With PB
.Title = "Enhanced Datasystems Progress Bar"
.Caption2 = "This is caption 2"
.Caption3 = "This is caption 3"
.Show
For nCounter = 0 To 100
.Progress = nCounter
.Caption1 = "Progress message " & CStr(nCounter)
For lWaitCount = 0 To 1000000
If UserCancelled = True Then GoTo EndRoutine
Next lWaitCount
Next nCounter
EndRoutine:
.Finish
End With
Set PB = Nothing
End Sub




Robin Hammond

Updated Modeless Progress Bar Class Available
 
And here's the link!
http://www.enhanceddatasystems.com/E...rogressBar.htm

Robin Hammond
www.enhanceddatasystems.com
Check out our XspandXL add-in


"Robin Hammond" wrote in message
...
If anyone is interested, following up on a previous post there's an

updated
version of a progress bar class up on my site. The updates now allow it to
run in Excel 97 as well as later versions (by using the status bar rather
than a modeless form if needed) meaning that the developer doesn't have to
worry about anything other than 95 users. The demo also shows how to

handle
a cancel during execution of a routine.

In brief, it displays the usual progress bar, a form title, up to three
captions, and an optional cancel button. Typical usage is shown below.
Hopefully it will help somebody...
Robin Hammond
www.enhanceddatasystems.com
Check out our XspandXL add-in


Public UserCancelled As Boolean

Sub ProgBarDemo()
Dim PB As clsProgBar
Dim nCounter As Integer
Dim lWaitCount As Long

Set PB = New clsProgBar
With PB
.Title = "Enhanced Datasystems Progress Bar"
.Caption2 = "This is caption 2"
.Caption3 = "This is caption 3"
.Show
For nCounter = 0 To 100
.Progress = nCounter
.Caption1 = "Progress message " & CStr(nCounter)
For lWaitCount = 0 To 1000000
If UserCancelled = True Then GoTo EndRoutine
Next lWaitCount
Next nCounter
EndRoutine:
.Finish
End With
Set PB = Nothing
End Sub







All times are GMT +1. The time now is 10:34 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com