Sub OpenSingleFile()
Dim Filter As String, Title As String
Dim FilterIndex As Integer
Dim Filename As Variant
On Error Resume Next
Filter = "Excel Files (*.xls),*.xls,"
FilterIndex = 3
Title = "Select a File to Open"
ChDrive ("E")
ChDir ("E:\excel")
With Application
Filename = .GetOpenFilename(Filter, FilterIndex, Title)
ChDrive (Left(.DefaultFilePath, 1))
ChDir (.DefaultFilePath)
End With
If Filename = False Then
MsgBox "No file was selected."
Exit Sub
End If
ImportThisOne CStr(Filename)
End Sub
Sub ImportThisOne(sFileName As String)
On Error Resume Next
Dim oBook As Workbook
Workbooks.Open sFileName
Set oBook = ActiveWorkbook
'Now do your processing on the newly imported sheet
On Error Resume Next
'Copy new sheet into this workbook
oBook.Worksheets(Sheet1).Copy after:=ThisWorkbook.Sheets(ThisWorkbook.Sheets.Count)
'close text file, do not save changes
'oBook.Close False
'Set oBook = Nothing
End Sub