habe Lösung gefunden
10.07.2002 17:00:46
Bongartz
So funktionierts:Sub PricatImport()
ActiveWorkbook.Worksheets.Add
With ActiveSheet.QueryTables.Add(Connection:= _
"TEXT;C:\Dokumente\Pricat.txt", Destination:=Range("A1"))
.Name = "Wilms"
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.TextFilePromptOnRefresh = False
.TextFilePlatform = xlWindows
.TextFileStartRow = 1
.TextFileParseType = xlFixedWidth
.TextFileTextQualifier = xlTextQualifierDoubleQuote
.TextFileConsecutiveDelimiter = False
.TextFileTabDelimiter = True
.TextFileSemicolonDelimiter = False
.TextFileCommaDelimiter = False
.TextFileSpaceDelimiter = False
.TextFileColumnDataTypes = Array(2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, _
2)
.TextFileFixedColumnWidths = Array(14, 14, 14, 10, 5, 30, 12, 7, 2, 2, 3, 3, 9, 7, 4, 7, 7, _
8, 8, 5, 2)
.Refresh BackgroundQuery:=False
End With
End Sub
Code eingefügt mit Syntaxhighlighter 1.13