i have another problem. i want to manualy input the file name in the
textbox so the macro can open it automatically. But it gives me an
error. Please help.
Private Sub CommandButton1_Click()
Dim intLastrow
intLastrow = Cells(65536, 1).End(xlUp).Row
With ActiveSheet.QueryTables.Add(Connection:= _
"TEXT; txtInputFile.text" _
, Destination:=Cells(intLastrow + 1, 1))
..Name = txtFileName.Text
..FieldNames = True
..RowNumbers = False
..FillAdjacentFormulas = False
..PreserveFormatting = True
..RefreshOnFileOpen = False
..RefreshStyle = xlInsertDeleteCells
..SavePassword = False
..SaveData = True
..AdjustColumnWidth = True
..RefreshPeriod = 0
..TextFilePromptOnRefresh = False
..TextFilePlatform = 437
..TextFileStartRow = 1
..TextFileParseType = xlDelimited
..TextFileTextQualifier = xlTextQualifierDoubleQuote
..TextFileConsecutiveDelimiter = False
..TextFileTabDelimiter = True
..TextFileSemicolonDelimiter = False
..TextFileCommaDelimiter = True
..TextFileSpaceDelimiter = False
..TextFileColumnDataTypes = Array(1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, _
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1)
..TextFileTrailingMinusNumbers = True
* .Refresh BackgroundQuery:=False*
End With
End Sub
Bold is wher it gives me a error
--
ikirin
------------------------------------------------------------------------
ikirin's Profile:
http://www.excelforum.com/member.php...o&userid=35599
View this thread:
http://www.excelforum.com/showthread...hreadid=553700