Private Sub CommandButton1_Click()
Dim myfile As Variant
Dim counter As Integer
Dim path As String
myfolder = "c:\tmp\"
ChDir myfolder
myfile = Application.GetOpenFilename(, , , , True)
counter = 1
If IsNumeric(myfile) = True Then
MsgBox "No files selected"
End If
While counter <= UBound(myfile)
path = myfile(counter)
Workbooks.Open path
counter = counter + 1
Wend
End Sub
No comments:
Post a Comment