I am using this code to import txt documents, but once the file has been selected and everything, the excel
data import wizard shows up... I now would like to get rid of this problem, as well add a standard path to this code, so that
I dont always have to start from the desktop and click through tons of folders to get the folder containing my files.
Dim DestBook As Workbook, SourceBook As Workbook
Dim DestCell As Range
Dim RetVal As Boolean
' Turn off screen updating.
Application.ScreenUpdating = False
' Set object variables for the active book and active cell.
Set DestBook = ActiveWorkbook
Set DestCell = ActiveCell
' Show the Open dialog box.
RetVal = Application.Dialogs(xlDialogOpen).Show("*.txt")
' If Retval is false (Open dialog canceled), exit the procedure.
If RetVal = False Then Exit Sub
' Set an object variable for the workbook containing the text file.
Set SourceBook = ActiveWorkbook
' Copy the contents of the entire sheet containing the text file.
' Activate the destination workbook and paste special the values
' from the text file.
' Close the book containing the text file.
btw, all the files are delimited and saved in folder C:/testfolder/ . However, I dont want to import all files of this
folder, only the one which has been selected.
Thanks for the help!!