F
Frank The Novice
Hello All,
Do any of you fine folks know why I keep getting a runtime error 5 when I
run this code?
'Mean time of sunrise (msr) and Time of Sunrise (ts)
msr = 90 - Val(lo)
tr1 = (Tan(Val(la))) * (Tan(dls)) + 0.10453 + (Cos(Val(la))) / (Cos(dls))
tr2 = ArcSin(tr1)
tsr = msr - tr2 + et
The code runs to this point, then I get a "Runtime Error 5 - Invalid
Procedure Call or Argument".
The deBug shows this as the culprit, but I can't figure out why.
Function ArcSin(X As Double) As Double
If X = 1 Then
ArcSin = PI() / 2
ElseIf X = -1 Then
ArcSin = -PI() / 2
Else
-- ArcSin = Atn(X / Sqr(-X * X + 1)) --
End If
End Function
Any ideas,
Frank
Do any of you fine folks know why I keep getting a runtime error 5 when I
run this code?
'Mean time of sunrise (msr) and Time of Sunrise (ts)
msr = 90 - Val(lo)
tr1 = (Tan(Val(la))) * (Tan(dls)) + 0.10453 + (Cos(Val(la))) / (Cos(dls))
tr2 = ArcSin(tr1)
tsr = msr - tr2 + et
The code runs to this point, then I get a "Runtime Error 5 - Invalid
Procedure Call or Argument".
The deBug shows this as the culprit, but I can't figure out why.
Function ArcSin(X As Double) As Double
If X = 1 Then
ArcSin = PI() / 2
ElseIf X = -1 Then
ArcSin = -PI() / 2
Else
-- ArcSin = Atn(X / Sqr(-X * X + 1)) --
End If
End Function
Any ideas,
Frank