Visual Basic for Applications Reference

Invalid procedure call or argument (Error 5)

See Also    Specifics

Some part of the call can't be completed. This error has the following causes and solutions:

  • An argument probably exceeds the range of permitted values. For example, the Sin function can only accept values within a certain range. Positive arguments less than 2,147,483,648 are accepted, while 2,147,483,648 generates this error.

    Check the ranges permitted for arguments.

  • This error can also occur if an attempt is made to call a procedure that isn't valid on the current platform. For example, some procedures may only be valid for Microsoft Windows, or for the Macintosh, and so on.

    Check platform-specific information about the procedure.

For additional information, select the item in question and press F1.