+ Reply to Thread
Results 1 to 5 of 5

Run-time error 5, Invalid procedure call or argument

  1. #1
    Forum Contributor
    Join Date
    04-21-2009
    Location
    England
    MS-Off Ver
    Excel 2016
    Posts
    710

    Run-time error 5, Invalid procedure call or argument

    I get this message and it debugs to my code here. The part in red is where it is highlighted by VBA

    Please Login or Register  to view this content.

    Anything obvious triggering this error?

  2. #2
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,431

    Re: Run-time error 5, Invalid procedure call or argument

    Impossible to tell from code snippet alone.
    The code compiles so it must be the values held in the variables.

    Use debugger to check content of the values and returned values from functions. Make sure the calculations result in positive values.
    Cheers
    Andy
    www.andypope.info

  3. #3
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,431

    Re: Run-time error 5, Invalid procedure call or argument

    Impossible to tell from code snippet alone.
    The code compiles so it must be the values held in the variables.

    Use debugger to check content of the values and returned values from functions. Make sure the calculations result in positive values.

  4. #4
    Forum Contributor
    Join Date
    04-21-2009
    Location
    England
    MS-Off Ver
    Excel 2016
    Posts
    710

    Re: Run-time error 5, Invalid procedure call or argument

    Hi Andy - many thanks for your reply.

    Please advise how i'd go about doing the last sentence?

  5. #5
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,431

    Re: Run-time error 5, Invalid procedure call or argument

    Quickest way, if you don't know how to use the debugging tools in VBE is to use Debug.Print command.
    This will output the values in the Immediate window. You can see the immediate window by typing CTRL+G in VBE

    Please Login or Register  to view this content.
    add extra lines for other parts of the command.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Run-time error '5': Invalid procedure call or argument
    By mcbruce76 in forum Excel Programming / VBA / Macros
    Replies: 24
    Last Post: 07-30-2013, 08:31 PM
  2. Macro Run Time error - Invalid procedure call or argument
    By clundeen in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-01-2011, 01:59 AM
  3. Invalid procedure call or argument error
    By Patrick Simonds in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-12-2006, 06:45 PM
  4. Replies: 2
    Last Post: 02-24-2006, 05:30 PM
  5. Run Time Error 5 - Invalid Procedure Call or Argument Q
    By John in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-26-2005, 05:05 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1