终于找到了补救由通过数据导出=>从文本选项上面的问题可以得到解决..
下面是相同的代码..
Do While fname <> ""
Workbooks.Add
Set wBook = ActiveWorkbook
Set wksht = ActiveSheet
With wksht.QueryTables.Add(Connection:="TEXT;" & folder_name & fname, Destination:=Range("$A$1"))
.Name = fname
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.TextFilePromptOnRefresh = False
.TextFilePlatform = 65001
.TextFileStartRow = 1
.TextFileParseType = xlDelimited
.TextFileTextQualifier = xlTextQualifierNone
.TextFileConsecutiveDelimiter = False
.TextFileTabDelimiter = True
.TextFileSemicolonDelimiter = False
.TextFileCommaDelimiter = False
.TextFileSpaceDelimiter = False
.TextFileColumnDataTypes = Array(1, 1, 1, 1, 1, 1, 1, 1, 1)
.TextFileTrailingMinusNumbers = True
.Refresh BackgroundQuery:=False
End With
VBA并不意味着用作其他程序的自动化。为什么不使用大容量文件重命名器(例如[Ant Renamer](http://portableapps.com/apps/utilities/ant_renamer_portable))将tsv文件重命名为txt文件? –
另存为csv文件'FileFormat:= xlCSV' – 0m3r
@Peh如果我直接重命名它有一些影响数据的bug形成。因此,我们必须在Notepadd ++中打开。 – Linga