+ Reply to Thread
Results 1 to 6 of 6

Function Error: Compile error: Expected: list separator or )

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    01-07-2004
    Posts
    314

    Function Error: Compile error: Expected: list separator or )

    Hi all,

    Using Excel 2013.

    My code is returning the error, not sure why?:
    Compile error: Expected: list separator or )
    Error here:
    lngMessageResponse = GetUserMessageResponse(strPrompt:="The selected worksheet does not contain any data." & vbCrLf & _
                                                                                               "Would you like to try a different worksheet?", _
                                                                             strTitle:="Missing Data Warning, _
                                                                             lngButtons:=vbYesNo)
    Calling this Function:
    Public Function GetUserMessageResponse(strPrompt As String, _
                                                                 strTitle As String, _
                                                                 lngButtons As Long) As Long
    Thoughts?

    thx
    w
    Kind regards,
    w

    http://dataprose.org

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

    Re: Function Error: Compile error: Expected: list separator or )

        lngMessageResponse = GetUserMessageResponse( _
                             strPrompt:="The selected worksheet does not contain any data." & vbLf & _
                                        "Would you like to try a different worksheet?", _
                             strTitle:="Missing Data Warning", _
                             lngButtons:=vbYesNo)
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Forum Contributor
    Join Date
    01-07-2004
    Posts
    314

    Re: Function Error: Compile error: Expected: list separator or )

    Thanks shg,

    That works.
    • Why vbLf as opposed to vbCrLf?
    • Why is the "_" necessary at the beginning of the parameter list?


    thx
    w

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

    Re: Function Error: Compile error: Expected: list separator or )

    1. Excel pretty much ignores carriage returns. For anything except writing output to a text file that requires the CR as part of the delimiter, line feed is sufficient.

    2. Not necessary, just keeps the lines shorter, more readable, and therefore to me, more maintainable.

    You were just missing a quote at the end of "... Warning"

  5. #5
    Forum Contributor
    Join Date
    01-07-2004
    Posts
    314

    Re: Function Error: Compile error: Expected: list separator or )

    Thanks shg,

    Appreciate the explanations.
    w

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

    Re: Function Error: Compile error: Expected: list separator or )

    You're welcome.

+ 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. [SOLVED] Compile Error Expected Function or Variable
    By shiser in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 05-22-2014, 09:18 AM
  2. Complie Error: Expected: list separator or (
    By Poornima Rajgopal in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-07-2013, 12:32 PM
  3. [SOLVED] Continue code on next line: Compile Error: expected list separator or )
    By ike609 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 10-05-2012, 08:28 AM
  4. compile error – expected : list separator or )
    By mdavid800 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-27-2011, 04:59 PM
  5. Compile error: Expected: list seperator or )
    By krish T in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-01-2010, 08:22 AM

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