![]() |
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 |
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 |
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 |
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 |
All times are GMT +1. The time now is 04:25 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com