H
H
hellcaster2018-06-01 15:34:47
Visual Basic
hellcaster, 2018-06-01 15:34:47

What to do if this error pops up?

The error pops up all the time:

Run-time error '5':
Invalid procedure call or argument

Here is the code
Function y(x)
y = 8.4 + (((x + 2.4) * Log(Abs(x))) / ((2 * x + 3) * (x + 8)))
End Function
Private Sub CommandButton2_Click()
Dim i As Double, step As Double, BoxCount As Double
i = 10
step = 0.1 * i
BoxCount = 1
    For x = 0 To i Step step
        UserForm1.Controls("TextBox" & BoxCount).text = x
        BoxCount = BoxCount + 1
        UserForm1.Controls("TextBox" & BoxCount).text = y(x)
        BoxCount = BoxCount + 1
    Next x
End Sub

By clicking on the Debug button, I get highlighted
y = 8.4 + (((x + 2.4) * Log(Abs(x))) / ((2 * x + 3) * (x + 8)))

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
shushpanio, 2018-06-01
@web_Developer_Victor

variables y and x are not declared

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question