View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Muhammed Rafeek M Muhammed Rafeek M is offline
external usenet poster
 
Posts: 179
Default Get all files from folder

Try tis code:

Dim Fname As Variant

Fname = Application.GetOpenFilename("Excel Files (*.xls),*.xls", 3, "Select
a File to Open" ,, True)
If Not IsArray(Fname) Then
MsgBox "No file was selected."
Exit Sub
End If
For i = LBound(Fname) To UBound(Fname)
msg = msg & Fname(i) & vbCrLf ' This can be removed
Workbooks.Open Fname(i)
Next i
......
.....
exit sub



"linglc" wrote:

I want to open all files in a folder but do not want to use input box. Is
there a way of using something like the open files window (which pops open if
you click File - Open menu in excel)?