3 Replies - 84218 Views - Last Post: 03 December 2009 - 01:41 PM Rate Topic: -----

#1 basistha_ashoke  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 2
  • Joined: 05-May 06

run-time error '5' invalid procedure call or argument

Posted 23 June 2006 - 03:02 AM

hi!
im facing a typical problem:
i developed some long program for statistical analysis in vba (from macro in excel) which runs ok in test mode on single series data; but shows "run-time error '5' invalid procedure call or argument" when run on multiple series: either
(i) runs and puts results for 1st 3 series and the error is displayed
(ii)when only 2 series are selected, 1st 2 are analysed and the error is displayed on inputting 3rd series.

the program is indeed long and not a clever one as it involves bubble sort etc. im not bothered about long running time as my other programs are doing - but this is behaving just peculiarly. please help me out of it. im attaching only those few lines which gives error:

Dim s As Integer
Dim vars_modified90 As Double
Dim vars_modified95 As Double
Dim vars_modified99 As Double
Dim z90 As Double
Dim z95 As Double
Dim z99 As Double

If s > 0 Then
z90 = CDbl(s - 1#) / (vars_modified90) ^ 0.5
z95 = CDbl(s - 1#) / (vars_modified95) ^ 0.5
z99 = CDbl(s - 1#) / (vars_modified99) ^ 0.5
ElseIf s = 0 Then
z90 = 0
z95 = 0
z99 = 0
ElseIf s < 0 Then
z90 = CDbl(s + 1#) / (vars_modified90) ^ 0.5 ' debug selects this
z95 = CDbl(s + 1#) / (vars_modified95) ^ 0.5
z99 = CDbl(s + 1#) / (vars_modified99) ^ 0.5
End If

if its a memory related problem, how can i release memory through code after one series is run?

many thanks in advance,
ashoke basistha

Is This A Good Question/Topic? 1

Replies To: run-time error '5' invalid procedure call or argument

#2 sontek  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 8
  • View blog
  • Posts: 283
  • Joined: 13-September 01

Re: run-time error '5' invalid procedure call or argument

Posted 27 June 2006 - 12:33 AM

It sounds like you need to lookup the method called 'DoEvents' thats that usually causes that error
Was This Post Helpful? 0
  • +
  • -

#3 shijobaby  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 07-August 09

Re: run-time error '5' invalid procedure call or argument

Posted 03 December 2009 - 05:25 AM

View Postsontek, on 26 Jun, 2006 - 11:33 PM, said:

It sounds like you need to lookup the method called 'DoEvents' thats that usually causes that error



http://accessaidprog...edure-call.html
Was This Post Helpful? 0
  • +
  • -

#4 guyfromri  Icon User is offline

  • D.I.C Addict

Reputation: 46
  • View blog
  • Posts: 817
  • Joined: 16-September 09

Re: run-time error '5' invalid procedure call or argument

Posted 03 December 2009 - 01:41 PM

turn error checking off


Was This Post Helpful? 0
  • +
  • -

Page 1 of 1