Run Time Error 424 (1 Viewer)

josros60

Registered User.
Local time
Yesterday, 23:54
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
 

kevlray

Registered User.
Local time
Yesterday, 23:54
Joined
Apr 5, 2010
Messages
1,046
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)?
 

kevlray

Registered User.
Local time
Yesterday, 23:54
Joined
Apr 5, 2010
Messages
1,046
I just looked up that error. It appears that may have to use the Set statement (i.e, Set ProgressBar1 = True).
 

josros60

Registered User.
Local time
Yesterday, 23:54
Joined
Mar 10, 2011
Messages
73
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

Top Bottom