+ Reply to Thread
Results 1 to 5 of 5

Argument Not Optional

  1. #1
    Forum Contributor mccrimmon's Avatar
    Join Date
    02-19-2004
    Location
    Scotland
    MS-Off Ver
    2003
    Posts
    249

    Argument Not Optional

    Hi

    I am wondering if anyone can help.
    I have the following code (this is amended from someone elses code that has now left the company, however, I cannot see where it is going wrong)

    All the variables are set as Private Const at the start of the module.

    When trying to step through I am getting an Argument Not Optional error.

    Can anyone spot if theres anything obvious mistake in the code from just looking at the below? It is erroring on the top line of the Call AddJournalLine line.

    Cheers

    McC

    Please Login or Register  to view this content.
    McCrimmon

  2. #2
    Registered User
    Join Date
    03-16-2004
    Location
    UK
    MS-Off Ver
    2003
    Posts
    85

    Re: Argument Not Optional Help

    The first thing I would chek is whether the number of vairables in the Call statement is different from the number of variables in the macro being called. I.e.
    Call Macro(A,B,C)
    Macro(A,B,C,D)
    wouldn't work unless delacred as Macro(A,B,C,Optional D)
    Phil

  3. #3
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Argument Not Optional

    Don't let that person come back ...
    Please Login or Register  to view this content.
    Entia non sunt multiplicanda sine necessitate

  4. #4
    Forum Contributor mccrimmon's Avatar
    Join Date
    02-19-2004
    Location
    Scotland
    MS-Off Ver
    2003
    Posts
    249

    Re: Argument Not Optional Help

    Quote Originally Posted by incjourn View Post
    The first thing I would chek is whether the number of vairables in the Call statement is different from the number of variables in the macro being called. I.e.
    Call Macro(A,B,C)
    Macro(A,B,C,D)
    wouldn't work unless delacred as Macro(A,B,C,Optional D)
    They always say two sets of eyes are better than one.
    Had additional commas within the code.

    Cheers for posting.

  5. #5
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Argument Not Optional

    There does appear to be more arguments than required, e.g
    Please Login or Register  to view this content.
    Check this
    Please Login or Register  to view this content.
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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