Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

hi referring to thread707-103495

Status
Not open for further replies.
many thanks,

but when I test the file (i attached it), i have an issue with set definition of new class modul.

class modul's name is correct.


 
combo, that's not the statusbar code ...

But perhaps the question we need to ask the OP is: why do you want this code when there is a perfectly good progress bar control included with Windows?
 
>when I test the file (i attached it),
Which file? The LED one, or combo's code?
 
the led one (link
Code:
Sub ProgressBarSimpleDemo()
    Dim sb As New clsProgressBar, i As Long
    Set sb = New clsProgressBar ' create a new progress bar   <= HERE
    sb.Show "Please wait", vbNullString, 0 ' display the progress bar
    For i = 0 To 100 Step 20
        sb.PercentComplete = i ' update the progress bar
        WaitSeconds 1
    Next i
    End With
    Set sb = Nothing ' remove the progress bar
End Sub
 
Just to be clear here. That code is ancient, and does not work on anything later than Excel 2003 for various reasons; for example later versions implement the ribbon interface, which meant there was a reworking of the statusbar. They also have a different Class for the statusbar hwnd.

(the code runs fine; just won't paint anything to the screen. This means that your issue with the class module is most likely something you introduced (probably a typo). But I'll just repeat, even if you fix that you will NOT see anything on screen, unless your version of Excel is 2003 or earlier
 
Out of curiosity....
Isn't that redundant:
Code:
Dim sb As [red]New[/red] clsProgressBar
Set sb = [red]New[/red] clsProgressBar

I would say, either:
Code:
Dim sb As [s]New[/s] clsProgressBar
Set sb = [red]New[/red] clsProgressBar
or
Code:
Dim sb As [red]New[/red] clsProgressBar
[s]Set sb = New clsProgressBar[/s]
but not both.

Or am I way off... [ponder]

---- Andy

"Hmm...they have the internet on computers now"--Homer Simpson
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top