Hey guys. Why dosnt this syntax import data from the file I choose?
Sub Makro1()
Dim filename As String
filename = Application.GetOpenFilename("Text Files (*.tsp),*.tsp", , "Please selec text file...")
With ActiveSheet.QueryTables.Add(Connection:= _
"TEXT;filename", _
Destination:=Range("$B$7"))
.Name = "a280"
.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
End With
End Sub
Sub Makro1()
Dim filename As String
filename = Application.GetOpenFilename("Text Files (*.tsp),*.tsp", , "Please selec text file...")
With ActiveSheet.QueryTables.Add(Connection:= _
"TEXT;filename", _
Destination:=Range("$B$7"))
.Name = "a280"
.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
End With
End Sub