Khắc phục lỗi invalid procedure call or argument năm 2024

Resolve Run-Time error '5': Invalid procedure call or argument

When opening SigmaXL, you receive the following error message:

.jpg?version=1&modificationDate=1544823446587&cacheVersion=1&api=v2&width=367&height=204]

The error can be resolved by completing the following:

  1. Click File:
  2. Click Options:
  3. Click Add-Ins, ensure Manage: Excel Add-ins is selected then hit Go...:
  4. Click Browse...:
  5. Choose the correct path for your bit-version of Excel: SigmaXL for 32 bit Excel Navigate to C:\Program Files [x86]\SigmaXL\V9.1 and double click the file SigmaXL_Classic_2016_Ribbon:
    SigmaXL for 64 bit Excel Navigate to C:\Program Files\SigmaXL\V9.1 and double click the file SigmaXL_Classic_2016_Ribbon:
  6. In the Add-Ins listing, ensure the file selected in step 5 is listed and checked. Click Browse: .jpg?version=1&modificationDate=1545082431132&cacheVersion=1&api=v2&width=250&height=313]
  7. Navigate to C:\Program Files [x86]\SigmaXL\V9.1 and double-click SigmaXL:
    Note for 64 bit Users 64-bit users must browse to the directory: C:\Program Files\SigmaXL\V9.1.
  8. Ensure both SigmaXL as well as the file selected in step 5 are checked. Click OK:
  9. Close and Re-Open Excel. You will no longer need to use the SigmaXL desktop icon to open SigmaXL.
    
    

Related articles

Yes, that's exactly what I meant. When you step through the code, you can examine each variable's or object's content, so you can make sure they are getting the correct data you're expecting. Otherwise, it may be causing the error you're seeing.

  • 5

What happened three or four days ago? Did you change anything, or did your IT department change anything?

I know that the most recent updates from Microsoft introduced at least one bug involving attachment fields, so it's not out of the question that something else along those lines is involved.

The highlighted error occurs here, i.e. this line is highlighted in yellow:

If ctlData.Name = "Updates" Then GoTo NextCtl

And the field in the table is also called "Updates" and that it is a memo field.

Given the fact that the memo field is somehow a problem now, you could try some things to see what happens.

  1. Rename the control on the form to something other than the same name as the field to which it is bound, such as txtUpdates.
  2. Use a different datatype field as a test to see if the issue is related to the memo field.
  • 6

Hello yes i make something different I insert some function Idle time that will close the ms access database if user is more than 15 min away. i try then then to comment that code out but then i started to get errores in module audit data which was perfect. ok i will try to learn how to make step in to the code to see what is the problem?

I will try to delete that idle form and see what happen....

thank you for your advices

  • 7

Might want to start indenting your code. You took the trouble to place within code tags, so well done, but without indentation, no need. I myself found that harder than need be to follow.

  • 8

Lets say i have some wrong code.. why ms access didnt tell me that one year ago? why now?

you mean that if i have some code writen 30 year ago...30 years is working good and then in 5 years will not working anymore?? that is not justice..

  • 9

    ok i will try to learn how to make step in to the code to see what is the problem?

This article might help... Good luck!

  • 10

Now I start to get some another errorr is my database destroying.............. what could be wrong here?

  • 11

Thanks dbguy I will read the article to see how to do that

  • 12

    Thanks dbguy I will read the article to see how to do that

See the link in my signature.

  • 13

    Now I start to get some another errorr is my database destroying.............. what could be wrong here?
View attachment 101269

You need to say what the error is? Number and description.

  • 14

    Lets say i have some wrong code.. why ms access didnt tell me that one year ago? why now?
you mean that if i have some code writen 30 year ago...30 years is working good and then in 5 years will not working anymore?? that is not justice..

I understand the frustration. Every time a new Windows or Office update is realized, we all hold our breath that it won't include another bug. It all too often does just that. On the other hand, if everything were locked down and static 30 years ago, we'd be missing out on more than one innovation, so it's not all that simple.

In this case, "something" changed, and the possibility that that is related to an Office or Windows Update is not high, but not zero either.

We have to move step by step through the trouble-shooting steps in a careful, objective approach as suggested by theDBGuy.

Did you recently do anything else? Upgrade the Access version on your computer, for example?

How about the data being processed? That highlighted line actually expects a non-Null value to be supplied as strNewNum and it doesn't allow for strings longer than 3 digits, i.e. 999 values. Are you now in excess of that number of records after processing things for a while?

One of the problems of old code is exactly that, it's old. It was based on "then" and perhaps "now" the situation is different. Perhaps some thought to how that could be involved will suggest other factors, as well.

  • 15

Hello

GPGeorge​

no I am at number 032 and code stops working. yes i will have to learn this steps. thanks for all advices i will spend some days in studying all that and testing the database my last update was 25 may...and i notice that 3 days ago [ i was testing the database all the time..almost every day...]

i have to resolve all that

  • 16

I'm going to take a really wild guess here. If I'm wrong, the test I propose is not difficult and won't break anything that wasn't already broken. [I think.] FIRST AND FOREMOST, make a copy of the file that contains your forms. Before you do ANYTHING ELSE, make that copy in a safe place so you can get back to where you were by deleting the test version that you just created and replacing it with that copy. So that means you get back to exactly where you were if this doesn't work.

Open that copy of the project. Look at any page of code, such as the code you showed us from post

10. From that VBA page, use the menu path Tools >> References. That will bring up the References dialog box, essentially a list of optional libraries to enable various types of automation.

In the complex reference dialog box, SLOWLY scroll through the checked references. See if ANY of them show up as either "missing" or "broken." It IS possible that more than one module would be affected. Don't stop this examination until you have examined every reference that had a check in its checkbox. You don't have to look at unchecked references. It would be rare to have more than a dozen checked references. For my worst project at work, it was only about 14 references. You are unlikely to have anywhere near that amount.

IF any checked items are missing or broken, note their names and then uncheck them. Now close that references box. Save the code now that you have cleared out the error/missing references. Close the project. Re-open it.

Now re-open the Tools >> References path from a VBA page again. It doesn't matter which one. Step through the references to find the ones that were unchecked as described above to see if you actually have the modules that were previously missing or broken. IF there is a reference with the same name, check it. After the update, perhaps you would see the same name but containing a different number. It is OK to use but you generally want the one with the highest number but otherwise the same name.

Now prepare to force Access to forget all prior compilation using the DECOMPILE method.

Part of that process in the link discusses doing a Compact & Repair operation. Attempt to decompile, then compile, then do the C&R

If the compilation succeeds, you SHOULD be good to go.

IF you had no missing or unchecked items, skip ahead to the DECOMPILE/RECOMPILE stuff.

If this doesn't work either, it is possible you have tripped over something in a patch. I know that earlier in the week I got patched on two nights in a row. That usually means a patch went wrong and got corrected the next day. Despite doing a pretty good job most of the time, Microsoft is quite capable of screwing up a good thing. If it really IS due to a bad patch, I can only advise patience for your problem.

  • 17

Helloo good news. yes the problem was with the reference library. I tryed: 1. new empty database and then I import all the objects from my last database = not working 2. an old database then I delete all the objects from that old database and import all the objects from the new database= Working 3. My last database= I try to check and uncheck the references that are the same like in my old database = not working

I have only 6 references. is that good? or I am misssing something?

sooo my question is? How that happen? Did I checked and checked the references? I think I didnt touch nothing...hmmm How do you know which references [ must be checked] you must have ? hmmmmmmm I was worry that suddenly the codes are not working anymore.

Thank you DocMan

  • 18

    How do you know which references [ must be checked] you must have ?

Some of it is obvious. For instance, if you are working on how to send mail with Outlook automation, you almost certainly need the Outlook libraries. If you are working on some kind of Excel operation other than simple import/export, you probably need the Excel library. Same ideas apply for Word or PowerPoint.

Let's say, for discussion, you wanted to use a FileSystemObject in your project. When you look up the Microsoft help on that FileSystemObject, you would find that you needed the Windows Scripting library to make it work.

The trickiest cases are if you wanted to use some third-party software, they would have to supply you with the library in the installation package and register that library during the install process. Then their documentation [usually a user's manual of some kind] would have to name the library you needed to automate with their product.

So to know what you need, know what you are intending to use.

In your case, you have listed a few "standard" references. You have the VBA library, Access 16.0 library, Office 16.0 database engine library - all of which are standard after an Access installation. I don't know about OLE being standard, but it isn't rare. You have two others - ADO 6.0 and Outlook 16.0 - and neither of those are unusual either.

I have only 6 references. is that good? or I am misssing something?

You know something is wrong when the code won't compile and calls out a line of code that has a function, subroutine, or object-related reference. If your code compiles, you don't have too few references. It might not be possible to so easily say whether you had too many references, though I guess it IS possible to have too many.

Chủ Đề