Question

Run-Time Error '5' invalid procedure or argument

Asked by: Moondancer

A fellow Moderator here created an excellent tool for the Mod team which helps us quickly query the database and find open and locked questions at a userid level so we can post scripts and begin the follow-up process in the cleanup effort.  He is unavailable for a while and I need some help quickly, so your "comments" are appreciated very much.

The API worked flawlessly until I upgraded from W98SE to Windows XP.  I've modified the registry, moved pertinent .ocx files to the proper directory, downloaded VB6 SP5 runtime and installed it, yet the problem persists.  I also modified the API (exe) to run in Windows 98 Compatibility mode, but nothing has fixed the problems I list below:

Query the database (uses Power Search) for MemberIDs I know have open Qs, but the results return as zero found, that's problem one.

Query the database for PAQ items, get results, but can't access; get an immediate response saying:
"Run-Time error '5':  Invalid procedure call or argument"
Then the application shuts down.

Found many hits and bugs by others searching MSDN and MS, most said this was a bug in VB5, fixed in VB6.  Since I updated my VB runtime, should have been fixed (one would think), but apparently not.

Thanks for your helpful comments.

Moondancer - EE Moderator

This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.

Subscribe now for full access to Experts Exchange and get

Instant Access to this Solution

  • Plus...
  • 30 Day FREE access, no risk, no obligation
  • Collaborate with the world's top tech experts
  • Unlimited access to our exclusive solution database
  • Never be left without tech help again

Subscribe Now

Asked On
2002-06-13 at 16:16:08ID20311459
Tags

error

,

procedure

,

invalid

,

argument

,

5

Topic

Visual Basic Programming

Participating Experts
5
Points
300
Comments
41

Trusted by hundreds of thousands everyday for fast, accurate and reliable tech support.

  • "The time we save is the biggest benefit of Experts Exchange to Warner Bros. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange." Mike Kapnisakis, Warner Bros.
  • "Our team likes having a resource that is more secure than just using Google and most experts using this service really know their stuff. It's nice to look here first versus using Google." Dayna Sellner, Lockheed Martin
  • "Anytime that I've been stumped with a problem, 9 out of 10 times Experts Exchange has either the accepted solution or an open discussion of the potential solution to the problem." Kenny Red, eBay Inc.

See what Experts Exchange can do for you.

Got a question?

We've got the answer.

Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.

Screenshot of Experts Exchange Knowledgebase

Need individual assistance?

Our experts are ready to help.

If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.

Screenshot of Experts Exchange Knowledgebase

Want to learn from the best?

Read articles from industry experts.

Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.

Screenshot of an Article

Working on a long term project?

Store your work and research.

Save solutions to your questions, answers you’ve discovered through searching plus helpful articles in your personal knowledgebase for easy future access.

Screenshot of Experts Exchange Knowledgebase

Access the answers to your technology questions today.

Subscribe Now

30-day free trial. Register in 60 seconds.

What Makes Experts Exchange Unique?

Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Trusted by the world's most respected brands.

image of each brand's logo

Faithfully serving IT professionals since 1996.

Experts Exchange Logo

Try it out and discover for yourself.

Subscribe Now

30-day free trial. Register in 60 seconds.

Related Solutions

  1. OCX !!...
    Here's my problem: I'm creating a net application and i used Microsoft Internet Transfer Control 6.0 in it. On my comp everything works find, But when i sent it to my frend for some testing it says "Component 'MSINET.OCX' or one of its dependecies not correctly registe...
  2. VB6 sp5 and DAO360.dll
    I'm using VB6 SP5 with an Access 2000 database. Before I installed service pack 5 and upgraded to Access 2000 from access 97 I used an 'X=Shell (Program Name, 1)' to start another application in the project group (there are 4 projects in the group). All was fine. I had to go ...
  3. SQL--Invalid Argument
    What does an Invalid Argument mean in SQL?

Free Tech Articles

  1. WARNING: 5 Reasons why you should NEVER fix a computer for free.
    It is in our nature to love the puzzle. We are obsessed. The lot of us. We love puzzles. We love the challenge. We thrive on finding the answer. We hate disarray. It bothers us deep in our soul. W...
  2. SCCM OSD Basic troubleshooting
    SCCM 2007 OSD is a fantastic way to deploy operating systems, however, like most things SCCM issues can sometimes be difficult to resolve due to the sheer volume of logs to sift through and the dispe...
  3. Migrate Small Business Server 2003 to Exchange 2010 and Windows 2008 R2
    This guide is intended to provide step by step instructions on how to migrate from Small Business Server 2003 to Windows 2008 R2 with Exchange 2010. For this migration to work you will need the fo...
  4. Create a Win7 Gadget
    This article shows you how to create a simple "Gadget" -- a sort of mini-application supported by Windows 7 and Vista. Gadgets can be dropped anywhere on the desktop to provide instant information, ...
  5. Outlook continually prompting for username and password
    There have been a lot of questions recently regarding Outlook prompting for a username and password whilst using Exchange 2007. There are a few reasons why this would happen and I will try to cover t...
  6. Backup Exchange 2010 Information Store using Windows Backup
    There seems to be quite a lot of confusion around the ability to backup Exchange 2010 using the built in Windows Backup feature. This stems from the omission of this feature prior to Exchange 2007 s...

Cloud Class Webinars

  1. Avoiding Bugs in Microsoft Access
    Alison Balter takes and in-depth look at avoiding bugs in Access. In this webinar you will learn about using the immediate window to debug your applications, invoking the debugger, using breakpoints to troubleshoot, stepping through code, setting the next statement to execute, ...
  2. Top 10 Best New Features in Visio 2010
    Scott Helmers gives live demonstrations of the top 10 new features in Visio 2010. This webinar will teach you how to create compelling diagrams by adding shapes to the page with a single click, linking the shapes in a diagram to data in Excel (or SQL Server, or SharePoint), ...
  3. IT Consultant Business Secrets Revealed
    Michael Munger, Experts Exchange tech pro and IT consultant, pulls back the curtain on his very successful businesses and answers question on every IT consultant and business owner should know about. He shares secrets on what he did to solve the 5 most common problems in IT, ...
  4. Disaster Recovery and Business Continuity
    Quest CTO, Mike Billon, gives an overview of the steps involved in building a dunamic disaster recovery plan. Through case studies and an examination of software/hardware tooles for monitoring and testing, you'll gain a better understandin of where you are, where you want ...
  5. Organize Your Visio Diagrams with Containers and Lists
    Scott Helmers uses cross functional flowcharts, wireframe diagrams, data graphic legends and seating charts to teach you: how to ustilize all three new structured diagram components in Visio 2010, the best practices for organizeing shapes in previous version of Visio, how to organize ...
  6. How to Us Objects, Properties, Events and Methods in Microsoft Access
    Alison Dalter gives an in-depbth look at objects, properties, events and methods in Microsoft Access. In this webinar you will learn about using the object browser, referring to objects, working with properties and methods, working with object variables, understanding the ...

Join the Community

Give a Little. Get a Lot.

Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.

Join the Community

Answers

 

by: MoondancerPosted on 2002-06-13 at 16:24:06ID: 7076836

I did find this on the Net, saying:
If you are getting "runttime error 5" "invalid procedure call or argument" and you are running Windows XP. You need this file riched32.dll (right click on the file name and choose "Save target as") and place them in your Windows system folder (usually C:\WINDOWS\SYSTEM).

But can't save it; try saving target as and only get the option to save register.htm

 

by: amebaPosted on 2002-06-13 at 16:29:27ID: 7076841

http:Q.20294299.html
andreouellet solved problem by adding DoEvents before SetFocus:

>But with the line "DoEvents" before the line "cmbRapport.SetFocus" the problem disappear

          DoEvents    'Problem disappear ???
          cmbRapport.SetFocus

 

by: MoondancerPosted on 2002-06-13 at 16:30:48ID: 7076843

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/CommCtls/richedit/richeditcontrols/aboutricheditcontrols.asp

This MSDN link shows that Windows XP already has riched32.dll... but still the problem persists.

 

by: MoondancerPosted on 2002-06-13 at 16:38:12ID: 7076855

Hi, Bruno, thanks a bunch.

Sorry to be dense, but I know little to nothing about VB and VB Controls.  Does this mean I have to recode and recompile?  If so, I'm clueless.

I'll check the Q you list above.

 

by: amebaPosted on 2002-06-13 at 16:42:29ID: 7076859

There are many possible causes for that error - without code you cannot do much.

>Query the database (uses Power Search) for MemberIDs I know have open Qs, but the results return as
zero found

I tried Power Search today and it doesn't work:
search for "button" (which is mentioned very often, btw) in VB topic area, in last 180 days and there were 0 matches.

 

by: MoondancerPosted on 2002-06-13 at 16:46:25ID: 7076863

True, Power Search results have been intermittent.  But I only used queries that I manually tested in realtime first for userIDs that returned results but the API returns none.  Maybe it's a Power Search problem.

I then tried the query for PAQ for Moondancer, and since I have over 3,000 in my PAQ, the screen did begin to produce visible results but then returned this error 5.  Do you suppose that the error could result just due to sheer volumes trying to be handled?

I'm truly baffled and most appreciative of your help.

I have the EXE, is that what I'd try to modify?  Remember, I'm clueless on the programming side of things.

:) Moondancer - EE Moderator

 

by: MoondancerPosted on 2002-06-13 at 16:48:04ID: 7076866

Could the runtime 5 error ever be a 'time out' kind of event?

 

by: amebaPosted on 2002-06-13 at 16:54:46ID: 7076878

You cannot modify EXE, you must have source code.

Or you can tell me what app does:
you enter username and it gives open questions? In which format?
Or does it automatically post something to each question?

 

by: amebaPosted on 2002-06-13 at 16:56:47ID: 7076881

>Could the runtime 5 error ever be a 'time out' kind of event?
It can be anything.

 

by: MoondancerPosted on 2002-06-13 at 17:12:02ID: 7076895

Also moved a key .ocx files into the windows directory, and found the same file in the windows\system32 directory, could that be a problem?

 

by: MoondancerPosted on 2002-06-13 at 17:18:40ID: 7076898

I'm getting ZERO notifs, Engineering advised, so watching this Q realtime.  Closed it so we can keep this streamlined and work on it together with minimum disruption.

It can autopost the Abandoner script, the function was included, but I'm only using it in basic mode now.  What it does is logs me in as a Moderator to access the Administrative functions.  Once logged in there is an OpenQ exe and the other for PAQs.  The only one I critically need (until Tuvok returns) is the OpenQ function.  I key in the Member ID and say GO... the API invokes Power Search for all Open and Locked Questions for that Member ID and imports the results into the API where I can then take direction actions to close the items.  That part is "broken", it never pulls in any results, and I do not get a runtime 5 error for that, I just get zero results (no open questions), which is in error.

Sorry for the confusion here, but I thought the PAQ module runtime error 5 "may" play a part in the empty results on the OpenQ module.

Let me know what else I should be telling you.  Or should I send you the ZIP file of the API package, would that help?

Thanks so much.

 

by: MoondancerPosted on 2002-06-13 at 17:20:06ID: 7076899

BTW, I do have riched32.dll in the windows\system directory, and it is version 5.1.2600 Wrapper Dll for Richedit 1.0

 

by: amebaPosted on 2002-06-13 at 17:26:46ID: 7076904

I don't think you can do anything without source - if any OCX is missing you'll get different error.

The programmer must find the line and procedure which gives the error...

Thanks for the grade  :-)

It seems app does more than just reading open and locked questions.
I can read/parse profile, and output those questions, but it seems that is only part of the story...

And I'm not moderator, so API's wouldn't work, I think...

 

by: amebaPosted on 2002-06-13 at 17:37:17ID: 7076914

My e-mail is in my profile, I can have a look if you send me something...

 

by: MoondancerPosted on 2002-06-13 at 17:44:26ID: 7076923

Thank you, sending now.

 

by: MoondancerPosted on 2002-06-13 at 17:48:12ID: 7076934

It is an incredibly excellent API and tuvok put tons of creative energy and work into designing it for us, I was the official tester. It does so much more than I can even begin to relate, I am the idea person and 100% clueless about the complexity and magic that Tuvok worked to bring the tool into being.  He is always and has always been there for me when I encounter roadblocks, but this roadblock has been here for me since I upgraded and my productivity is seriously degraded.  If he were available, he'd have fixed it for me without a doubt, as he's fixed others before.  I appreciate your help very much, and wish I could tell you more of the details.  Hopefully he'll return soon and see my pleading Email and this link.

 

by: amebaPosted on 2002-06-13 at 17:53:52ID: 7076942

Thanks, I'm receiving it... I'll check it and see if I can do something...

 

by: amebaPosted on 2002-06-13 at 19:20:21ID: 7077056

I extracted one zip file (there are other files, but utility to extract from "tnef" doesn't work good) and installed ModTools.

I'm also receiving Run-Time error '5', so it has nothing to do with XP.  I think format of the page with search results changed, and program cannot parse/read that page.

My program also stopped working last week because of changed links.
It will be simple for programmer to change program to recognize underscore in question links.

 

by: amebaPosted on 2002-06-13 at 21:54:31ID: 7077296

Summary:

Links have been changed on 5 (or 6) June 2002
Before, we had dot "." between Q and question number, e.g. Q.20311459.html
Now, it's underscore "_" e.g. Q_20311459.html

I changed my program QuickPost, to read question lists with new links, in 30 minutes.
Tuvok will have to do the same with his program.

--------------------
Moving files riched32.dll or some OCX-es to different directory won't help.
--------------------
It has nothing to do with XP, since the same problem "Runtime error 5" is on my Win95 system.
So, going back to Win98 from XP won't help.
--------------------

I cannot change Tuvok's program, because I do not have source code.

--------------------
I can create new program which can read PAQs or opened and locked questions.
But, this is not useful for you - since you need automatic posting, and that (automatic posting) is the part which I didn't try and I would need time to create/test that functionality.
--------------------

 

by: MoondancerPosted on 2002-06-14 at 06:01:35ID: 7078109

YOu've done plenty by helping me understand the programming changes to the QID format (wish I misssed completely), and thank you very much.  You more than earned these points.  I'll send this link to Tuvok and, again, thank you.

:) Moondancer - EE Moderator

 

by: amebaPosted on 2002-06-14 at 06:05:25ID: 7078115

Thanks again for the points and grade!

Bruno

 

by: MoondancerPosted on 2002-06-14 at 11:17:38ID: 7079046

Thanks to you, Bruno for all your help over and above "the call of duty", so to speak.

I'm still getting no Email notifs, quite frustrating.

But smiling anyway.

:)

 

by: TuvokPosted on 2002-06-17 at 01:15:36ID: 7083207

Hi guys!

Bruno, thanks for covering for me ;-)

The format of the search page is changed, as Bruno suggested. Since ModTools still is in beta version, I did not include all error handling.
This is an easy fix. Hope to come to it within a couple of days. But as you know Moonie, I don't have internet access all the time ... :(

Live long and prosper.
Best regards my friends,
Tuvok

 

by: amebaPosted on 2002-06-17 at 01:57:01ID: 7083258

Thanks, Tuvok.  It's a nice and useful program.  Good work!

Bruno

 

by: MoondancerPosted on 2002-06-17 at 07:40:14ID: 7083881

I LOVE IT!  Thank you thank you thank you.

Still no fix for the Moondancer@experts-exchange.com notifs (since 6/12), and many have since been purged.  Very sad.

Oh well, as always, I'm in deepest appreciation mode to you both.

Tuvok's tool is the most excellent tool I've used (API) in all the years I've used APIs to automate redundant processes, and he's been here for me in all regards to fix things and/or further enhance the program.  I just can't find enough words of praise and appreciation for all that he has done for our team here.

:) Moondancer - EE Moderator

 

by: TuvokPosted on 2002-06-17 at 23:08:08ID: 7085750

:"> Thanks Moonie! I'm blushing!

Bruno, if you like, you can have the source code.
Just mail me.... You know my addy (just look in the help of ModTools).

T

 

by: MoondancerPosted on 2002-06-18 at 15:32:44ID: 7091075

COOL, great.  Blushing is good.  ;)
Finally got Email from 6/17 onward, prior time, gone (so far).  Boo hoo.
Thanks,
Moondancer - EE Moderator

 

by: amebaPosted on 2002-06-19 at 04:41:47ID: 7092336

Thanks, Tuvok.
If the tool isn't updated yet, I can try updating it to new type of links - in that case, please, send me the source;  my e-mail is in my profile, or I think it's also in you address book (as Bruno Paris)

 

by: TuvokPosted on 2002-06-19 at 04:48:23ID: 7092346

Bruno, I will send you the source a.s.a.p.
(indeed I have your personnal addy...)

I know you can fix it also. Thanks!

T

 

by: amebaPosted on 2002-06-19 at 05:33:45ID: 7092432

OK. Thank you!

 

by: MoondancerPosted on 2002-06-19 at 05:57:53ID: 7092505

HUGS and thanks. :)

 

by: MoondancerPosted on 2002-06-23 at 05:53:17ID: 7101571

Hi, ameba.

I know Tuvok has had Internet access roadblocks, and probably why you haven't yet received the source code.

Moondancer - EE Moderator

 

by: amebaPosted on 2002-06-23 at 11:27:15ID: 7101965

OK.  No problem.  :-)

 

by: amebaPosted on 2002-06-25 at 07:34:58ID: 7107705

Hi, all
I received source files and changed "Q." to "Q_" and it seems reading now works.

I don't know if any other function is not working...

Exe file (zipped) sent to Moondancer for test...

 

by: TuvokPosted on 2002-06-25 at 23:12:32ID: 7109781

Great!
Thanks Bruno!!

T

 

by: MoondancerPosted on 2002-06-26 at 04:21:27ID: 7110224

Thank you so much, Tuvok and ameba.  Works fine, no problems; we love Tuvok's tool, it makes our productivity so much better.  Your help in dealing with the reformatted URL "roadblock" is appreciated, and thanks very much to Tuvok for sharing his code.

Sent it to our entire team and we're all grateful.

:) Moondancer - EE Moderator

 

by: MoondancerPosted on 2002-07-03 at 10:30:15ID: 7127623

Moondancer is leaving as a Moderator effective today and all Moondancer Email will be forwarded to others effective tomorrow.
It's been great, thanks for all the help and support.
:) Moondancer - EE Moderator

 

by: BobJacobsonPosted on 2003-01-12 at 14:02:38ID: 7713194

I have had the same problem with one of my apps, it turned out to be a simple little problem with a message box routine.  

Dim Response

Response = msgbox("Are you sure you want to format your hard drive?", vbOKCancel, "WARNING")



It was crashing before the message box.  I added the full variable type and it fixed the problem.  It worked fine when running from within VB, but once compiled, it didn't like it.

Dim Response As VbMsgBoxResult

Hope this may help...

 

by: BobJacobsonPosted on 2003-01-24 at 07:45:26ID: 7800947

I am also having problems with the runtime error 5 messages.  It works on some machines and not others even though they are the same OS's. I am trying to track it down myself.  I do know that I fixed one of the messages by actually DIMming a variable without a variant type.

Example:

  I had dimmed a variable for a message box response like this:

Dim Response

I added the extra "As VbMsgBoxResult", to read:

Dim Response As VbMsgBoxResult

This fixed the problem! This other way has worked for quite sometime.  I hope this helps. I am now dealing with the same issue on a UserID.SetFocus command on a form.  It worked all of the time, now that I added some other controls to the project, it seems to be acting up.

Can anyone shed anymore light on this situation?

               Bob

 

by: rovermPosted on 2003-01-24 at 08:37:25ID: 7801307

Hi Bob,

The runtime error 5 in the situation Moonie had, didn't have anything to do with programming errors orso.
It was just a change in the URL that ModTools tried to reach and that caused the error.

The error you are getting now could be that the SetFocus method is called to early, for instance in the FormLoad event.
Try calling it in the Form_Activate event.

D'Mzzl!
RoverM

 

by: MSeitzPosted on 2003-05-08 at 23:52:12ID: 8493782

I just had the same problem, and am a little embarrassed at what I found: The message box generates a form_paint event (I don't know if matters that the msgbox obscures part of the form or not). If there are any '.setfocus' instructions in the paint procedure, these will generate an error, since the focus is simultaneously being assigned to the msgbox and a control in the form, or the form itself.

I hope this helps you.

regards,
Markus

20120131-EE-VQP-002

3 Ways to Join

30-Day Free Trial

The Experts

98% positive feedback on 31,087 answers since March 2000. angeliii is a Microsoft Most Valuable Professional for his work with MS SQL Server & Develoment.

He has also proven his knowledge of Visual Basic Programming, PHP Scripting and Oracle Databases.

The Experts

97% positive feedback on 10,752 answers since July 2000. lrmoore has more than 18 years experience in the networking industry.

The six-time Mircosoft MVPs specialties include firewalls, virtual private networking, and network management.

Testimonials

"...and excellent source for support... Kind of like having your very own IT dept." Electriciansnet

Testimonials

"I was apprehensive at signing up at first. However... it has already made my life as an IT administrator much easier." JaCrews

Testimonials

"WOW! You guys have great, active, and knowledgeable people on here." moore50

Business Clients

Business Clients

In the Press

"If you’ve got a question... Experts Exchange can supply an answer.”

In the Press

"...an invaluable aid for both IT professionals and those who require tech support."

In the Press

"where IT professionals provide quick answers on just about any topic"

Business Account Plans

Loading Advertisement...