Invalid Procedure Call or Argument (VB6)

There are many reasons as to why an 'invalid procedure call' exception is thrown in a VB6 environment. For instance..

1. Negative values

- When assigning a negative values to an attribute or functions. For instance, when assigning a negative value to the function 'chr'

chr(-12)

2. Form not loaded

- When invoking something which the form is not loaded such as setfocus.

3. Key don't exist in a collection

- when retrieving an item from a collection where the key don't exist or it has been deleted before you know it.

It is hard to debug 'invalid procedure call' without checking out the codes, in case you have a dll file, you can't do anything about it.

Comments