compile error: Expected: = ...Why?

  • Thread starter Thread starter cesw
  • Start date Start date
C

cesw

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.
 
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



in message
news:[email protected]...
 
Back
Top