+ Reply to Thread
Results 1 to 4 of 4

compile error: Expected: = ...Why?

  1. #1
    Registered User
    Join Date
    09-09-2005
    Posts
    8

    compile error: Expected: = ...Why?

    I have the following snippet that is getting this compile error

    If ckbCustID = True Then
    MsgBox ("run Customer / Interdealer Rpt")
    modCustID(tbStart, tbEnd)
    End If


    modCustID is another module in the add-in defined:

    Sub modCustID(startDt, endDt)
    ...
    end sub


    so can anyone shed some light on why the compiler seems to want an = after the call?

    Thx.

  2. #2
    Chip Pearson
    Guest

    Re: compile error: Expected: = ...Why?

    Don't enclose the parameters in parentheses when you call
    modCustID. Change
    modCustID(tbStart, tbEnd)
    to
    modCustID tbStart, tbEnd

    You enclose parameters in parentheses only when calling a
    Function procedure, not a Sub procedure.

    --
    Cordially,
    Chip Pearson
    Microsoft MVP - Excel
    Pearson Software Consulting, LLC
    www.cpearson.com



    "cesw" <[email protected]> wrote
    in message
    news:[email protected]...
    >
    > I have the following snippet that is getting this compile error
    >
    > If ckbCustID = True Then
    > MsgBox ("run Customer / Interdealer Rpt")
    > modCustID(tbStart, tbEnd)
    > End If
    >
    >
    > modCustID is another module in the add-in defined:
    >
    > Sub modCustID(startDt, endDt)
    > ..
    > end sub
    >
    >
    > so can anyone shed some light on why the compiler seems to want
    > an =
    > after the call?
    >
    > Thx.
    >
    >
    > --
    > cesw
    > ------------------------------------------------------------------------
    > cesw's Profile:
    > http://www.excelforum.com/member.php...o&userid=27117
    > View this thread:
    > http://www.excelforum.com/showthread...hreadid=466361
    >




  3. #3
    Norman Jones
    Guest

    Re: compile error: Expected: = ...Why?

    Hi Cesw,

    Try changing:

    > modCustID(tbStart, tbEnd)


    to

    modCustID tbStart, tbEnd


    ---
    Regards,
    Norman



    "cesw" <[email protected]> wrote in message
    news:[email protected]...
    >
    > I have the following snippet that is getting this compile error
    >
    > If ckbCustID = True Then
    > MsgBox ("run Customer / Interdealer Rpt")
    > modCustID(tbStart, tbEnd)
    > End If
    >
    >
    > modCustID is another module in the add-in defined:
    >
    > Sub modCustID(startDt, endDt)
    > ..
    > end sub
    >
    >
    > so can anyone shed some light on why the compiler seems to want an =
    > after the call?
    >
    > Thx.
    >
    >
    > --
    > cesw
    > ------------------------------------------------------------------------
    > cesw's Profile:
    > http://www.excelforum.com/member.php...o&userid=27117
    > View this thread: http://www.excelforum.com/showthread...hreadid=466361
    >




  4. #4
    Dave Peterson
    Guest

    Re: compile error: Expected: = ...Why?

    Another option is to use the Call statement:

    Call modCustID(tbStart, tbEnd)



    cesw wrote:
    >
    > I have the following snippet that is getting this compile error
    >
    > If ckbCustID = True Then
    > MsgBox ("run Customer / Interdealer Rpt")
    > modCustID(tbStart, tbEnd)
    > End If
    >
    > modCustID is another module in the add-in defined:
    >
    > Sub modCustID(startDt, endDt)
    > ..
    > end sub
    >
    > so can anyone shed some light on why the compiler seems to want an =
    > after the call?
    >
    > Thx.
    >
    > --
    > cesw
    > ------------------------------------------------------------------------
    > cesw's Profile: http://www.excelforum.com/member.php...o&userid=27117
    > View this thread: http://www.excelforum.com/showthread...hreadid=466361


    --

    Dave Peterson

+ 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