Sub
ImportFile1()
Dim
strFile1
As
String
Dim
qry
As
QueryTable
strFile1 =
"Z:\Temp\Datei 1.txt"
Set
qry = ActiveSheet.QueryTables.Add(Connection:= _
"Text;"
& strFile1, Destination:=Range( _
"$A$1"
))
With
qry
.Name =
"Datei 1"
.FieldNames =
True
.RowNumbers =
False
.FillAdjacentFormulas =
False
.PreserveFormatting =
True
.RefreshOnFileOpen =
False
.RefreshStyle = xlInsertDeleteCells
.SavePassword =
False
.SaveData =
True
.AdjustColumnWidth =
True
.RefreshPeriod = 0
.TextFilePromptOnRefresh =
False
.TextFilePlatform = 850
.TextFileStartRow = 1
.TextFileParseType = xlFixedWidth
.TextFileTextQualifier = xlTextQualifierDoubleQuote
.TextFileConsecutiveDelimiter =
False
.TextFileTabDelimiter =
True
.TextFileSemicolonDelimiter =
False
.TextFileCommaDelimiter =
False
.TextFileSpaceDelimiter =
False
.TextFileColumnDataTypes = Array(1)
.TextFileTrailingMinusNumbers =
True
.Refresh BackgroundQuery:=
False
End
With
qry.Delete
End
Sub
Sub
ImportFile2()
Dim
qry
As
QueryTable
Dim
strFile2
As
String
strFile2 =
"Z:\temp\Datei 2.txt"
Set
qry = ActiveSheet.QueryTables.Add(Connection:= _
"TEXT;"
& strFile2, Destination:=Range( _
"$A$1"
))
With
qry
.Name =
"Datei 2"
.FieldNames =
True
.RowNumbers =
False
.FillAdjacentFormulas =
False
.PreserveFormatting =
True
.RefreshOnFileOpen =
False
.RefreshStyle = xlInsertDeleteCells
.SavePassword =
False
.SaveData =
True
.AdjustColumnWidth =
True
.RefreshPeriod = 0
.TextFilePromptOnRefresh =
False
.TextFilePlatform = 850
.TextFileStartRow = 6
.TextFileParseType = xlDelimited
.TextFileTextQualifier = xlTextQualifierDoubleQuote
.TextFileConsecutiveDelimiter =
False
.TextFileTabDelimiter =
True
.TextFileSemicolonDelimiter =
False
.TextFileCommaDelimiter =
True
.TextFileSpaceDelimiter =
False
.TextFileColumnDataTypes = Array(1, 1)
.TextFileTrailingMinusNumbers =
True
.Refresh BackgroundQuery:=
False
End
With
qry.Delete
End
Sub