Dim
varDatei
As
Variant
Dim
Dateiname, Datei
As
Variant
varDatei = Application.GetOpenFilename()
If
varDatei =
False
Then
MsgBox
"Der Benutzer hat abgebrochen."
, vbInformation
Else
Datei = vbCrLf + varDatei
End
If
Dateiname = InputBox(
"Bitte den Dateinamen eingeben."
)
Cells(1, 1) = Datei
Cells(2, 1) = Dateiname
Cells(3, 1) = varDatei
With
ActiveSheet.QueryTables.Add(Connection:= _
"TEXT;"
+ Datei _
, Destination:=Range(
"$A$1"
))
.Name =
"2017_06_20_08_03_47.txt"
.FieldNames =
True
.RowNumbers =
False
.FillAdjacentFormulas =
False
.PreserveFormatting =
True
.RefreshOnFileOpen =
False
.RefreshStyle = xlInsertDeleteCells
.SavePassword =
False
.SaveData =
True
.AdjustColumnWidth =
True
.RefreshPeriod = 0
.TextFilePromptOnRefresh =
False
.TextFilePlatform = 1252
.TextFileStartRow = 1
.TextFileParseType = xlDelimited
.TextFileTextQualifier = xlTextQualifierDoubleQuote
.TextFileConsecutiveDelimiter =
False
.TextFileTabDelimiter =
True
.TextFileSemicolonDelimiter =
False
.TextFileCommaDelimiter =
False
.TextFileSpaceDelimiter =
False
.TextFileColumnDataTypes = Array(1)
.TextFileTrailingMinusNumbers =
True
.Refresh BackgroundQuery:=
False
End
With