title: VBA multi-parameter function call Syntax Error
body: <p>I'm trying to call a function in Excel VBA (2007), and am recieving a syntax error on the call. I have an array of data structures called ImportSets, which contains worksheets and strings, and am trying to pass members of items in that array to a function, called Import. </p>
  
  <p>The calling code looks like this: <p></p>
  
  <pre><code>For n = 1 To 7  
      Debug.Print ("Destsheet: " &amp; ImportSets(n).DestSheet.name)  
      Debug.Print ("Sourcesheet: " &amp; ImportSets(n).SourceSheet.name)  
      Debug.Print ("Sourcecolumn: " &amp; ImportSets(n).SourceColumn)  
      Import(CostAnalysisWorksheet.Sheets("Reimbursements"), ImportSets(n).DestSheet, ImportSets(n).SourceSheet, ImportSets(n).SourceColumn)  
  Next n  
  </code></pre>
  
  <p><p>All of the Debug.Print statements return meaningful and correct strings, and check for the existence of "Reimbursements" returns true. The method call is on one line. Here is the ImportSet object code: </p>
  
  <pre><code>Public Type ImportSet
      DestSheet As Worksheet
      SourceSheet As Worksheet
      SourceColumn As String
      ...other code...
  End Type
  </code></pre>
  
  <p>The function body looks like this:<p></p>
  
  <pre><code>Function Import(ByRef ReimbursementSheet As Worksheet, ByRef DestSheet As Worksheet, ByRef ImportSheet As Worksheet, ByRef ImportSheetPriceColumn As String) As String  
      ....code here .....  
  End Function
  </code></pre>
  
  <p>I am getting a red-highlighted syntax error on the function call (in the first snippet). I am probably missing something stupid. What is it?</p>