Run Time Error 424

josros60

Registered User.
Local time
Yesterday, 17:30
Joined
Mar 10, 2011
Messages
73
I am getting this message when I exit a userform,

Run Time Error 424, object required,

Code:

Code:
Private Sub CommandButton4_Click()
ProgressBar1.Visible = True
For i = 1 To 10000
ProgressBar1 = i * 100 / 10000
Next
ProgressBar1.Visible = False

Application.Visible = True
Unload Me
End Sub

Please help,
thanks
 
Of course the first question is what kind of object is ProgressBar1. Second, not that it is necessary in most cases. Shouldn't you define i (i.e., Dim i As Integer)?
 
I just looked up that error. It appears that may have to use the Set statement (i.e, Set ProgressBar1 = True).
 
I realize what the problem is:

there's graphical bar that shows the percentage for saving/deleting/exiting the form but for some reason that frame doesn't appear in the userform.

any idea how solve it,

here it's the code that points when getting the error:

Code:
Private Sub CommandButton4_Click()
ProgressBar1.Visible = True
For i = 1 To 10000
ProgressBar1 = i * 100 / 10000
Next
ProgressBar1.Visible = False

Application.Visible = True
Unload Me

thanks again.
 

Users who are viewing this thread

Back
Top Bottom