Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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. -- cesw ------------------------------------------------------------------------ cesw's Profile: http://www.excelforum.com/member.php...o&userid=27117 View this thread: http://www.excelforum.com/showthread...hreadid=466361 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
compile error: Expected: = ...Why?
Hi Cesw,
Try changing: modCustID(tbStart, tbEnd) to modCustID tbStart, tbEnd --- Regards, Norman "cesw" wrote in message ... 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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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" wrote in message ... 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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Micrsoft Visual Basic Compile error: Expected: end of statement | Excel Discussion (Misc queries) | |||
Pivot Table Wizard Error (Expected 52) | Excel Discussion (Misc queries) | |||
Compile Error: Expected End Property | Excel Programming | |||
compile error: expected variable or function | Excel Discussion (Misc queries) |