INVALID PROCEDURE CALL OR ARGUMENT

  • Thread starter Thread starter Philosophaie
  • Start date Start date
P

Philosophaie

Dim V, E ,m,r as double

'error line
V=(2*(E - m/r))^.5
'all the variables have values to them

When I run it I get:

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

What may be the error?
 
Dim V, E ,m,r as double

'error line
V=(2*(E - m/r))^.5
'all the variables have values to them

When I run it I get:

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

What may be the error?

I cannot reproduce your error given the information you have provided. Your
error is likely from something you have not told us about.
--ron
 
Sub philo()
Dim e As Double, m As Double, r As Double, v As Double
e = 100
m = 10
r = 2
v = (2 * (e - m / r)) ^ 0.5
MsgBox v
End Sub


Just be sure thaqt yoiu are taking the square root of a POSITIVE number.
 
Something like this will produce the same error as you had.

V=(-2)^.5

This is what Gary's Student has already mentioned.

Keiji
 
Back
Top