Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Micrsoft Visual Basic Compile error: Expected: end of statement IJ Excel Discussion (Misc queries) 5 October 23rd 06 12:08 AM
Pivot Table Wizard Error (Expected 52) Guest Excel Discussion (Misc queries) 0 April 28th 06 10:10 PM
Compile Error: Expected End Property George J[_3_] Excel Programming 4 August 3rd 05 03:35 PM
compile error: expected variable or function MMM Excel Discussion (Misc queries) 3 December 24th 04 03:11 PM


All times are GMT +1. The time now is 09:15 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"