INVALID PROCEDURE CALL OR ARGUMENT

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?
 
R

Ron Rosenfeld

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
 
G

Gary''s Student

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.
 
K

keiji kounoike

Something like this will produce the same error as you had.

V=(-2)^.5

This is what Gary's Student has already mentioned.

Keiji
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top