Option Explicit
Sub loopyarray()
' http://support.microsoft.com/kb/141574/ja
Dim filenames As Variant
Dim counter As Long
' set the array to a variable and the True is for multi-select
filenames = Application.GetOpenFilename( _
FileFilter:="Microsoft Excelブック,*.xls", MultiSelect:=True)
counter = 1
If IsArray(filenames) Then
On Error Resume Next
' ubound determines how many items in the array
While counter <= UBound(filenames)
' Opens the selected files
Workbooks.Open filenames(counter)
' displays file name in a message box
MsgBox filenames(counter)
' increment counter
counter = counter + 1
Wend
Else
Exit Sub
End If
End Sub