title: Passing nested array as parameter for function in VBA results in compile error "Expected: ="
body: <p>I am attempting to Construct an array (testSheets) that holds a file name and a file path as strings. I then wish to contain this array inside of another array (shtsTmpl). Then, I want to pass the strings within the nested array into a function's parameters (copySheets) to simply return the combined file path in a msgbox.</p>
  
  <p>This first bit of code successfully returns "TSTSheets.xlsx" in a msg box.</p>
  
  <pre><code>Sub prepSheets()
   Dim testSheets() As Variant
   ReDim testSheets(0)
   testSheets(0) = "TSTSheets.xlsx"
  
   Dim shtsTmpl() As Variant
   shtsTmpl = Array(testSheets)
  
   copySheets (shtsTmpl(0)(0))
  
  End Sub
  
  Function copySheets(srcName As String)
   MsgBox (srcName)
  End Function
  </code></pre>
  
  <p>This second bit of code returns a compile error that says "Expected: =" at the line that calls the copySheets function and I do not understand why.</p>
  
  <pre><code>Sub testSheets()
   Dim testSheets() As Variant
   ReDim testSheets(1)
   testSheets(0) = "TSTSheets.xlsx"
   testSheets(1) = "C:\"
  
   Dim shtsTmpl() As Variant
   shtsTmpl = Array(testSheets)
  
   copySheets (shtsTmpl(0)(0),shtsTmpl(0)(1))
  End Sub
  
  Function copySheets(srcName As String, srcPath As String)
   MsgBox (srcPath &amp; srcName)
  End Function
  </code></pre>
  
  <p>Can someone please explain to me why the code compiles correctly when the function has one parameter and incorrectly when the function has two parameters?</p>
  
  <p>Please let me know if you need further explanation.</p>
  
  <p>Thank you.</p>