title: Assign Workbooks to Array when opening Multiple Workbooks by ParamArray
body: <p>I open multiple files using ParamArray.</p>
  
  <p>How do I assign the workbooks to an array to access them individually? For example, to get the last row of each workbook.</p>
  
  <p>The error is</p>
  
  <blockquote>
    <p>subscript out of range</p>
  </blockquote>
  
  <pre><code>Sub main()
   Call COMBINED_FILES("wk1.csv","wk2.xlsx","wk3.xls","wk4.csv")
  End Sub
  
  Sub COMBINED_FILES(ParamArray SOURCE_FILE_NAME_WITH_EXTENTION() As Variant) 
  
   Dim MASTER_WORK_BOOK_PATH As String
   MASTER_WORK_BOOK_PATH = ActiveWorkbook.Path &amp; "\"
  
   Dim MASTER_WORK_BOOK As Workbook
   Set MASTER_WORK_BOOK = ActiveWorkbook
  
   Dim I As Integer
  
   For I = 1 To UBound(SOURCE_FILE_NAME_WITH_EXTENTION)
       Dim Resultworkbook() As Workbook
       Set Resultworkbook(I) = Workbooks.Open(MASTER_WORK_BOOK_PATH &amp; SOURCE_FILE_NAME_WITH_EXTENTION(I))
       Debug.Print SOURCE_FILE_NAME_WITH_EXTENTION(I)
   Next I
  End sub
  </code></pre>