VBA错误只发生在Excel 2013(不是2007或2010)

以下VBA代码是从CSV文件中提取数据的macros的一部分。 在运行Excel 2007和2010的许多PC上运行正常,但运行Excel 2013的PC上出现以下错误。

“运行时错误1004:应用程序定义或对象定义的错误”

该错误发生在以下行

.Refresh BackgroundQuery:=False 

如果我注释掉这一行,我不会收到错误,但是我也没有收到导入的数据。

任何帮助将被感激地接受。

 With ActiveSheet.QueryTables.Add(Connection:=connectionName, Destination:=Range("$A$1")) .Name = "por800.csv" .FieldNames = True .RowNumbers = False .FillAdjacentFormulas = False .PreserveFormatting = True .RefreshOnFileOpen = False .RefreshStyle = xlOverwriteCells .SavePassword = False .SaveData = True .AdjustColumnWidth = True .RefreshPeriod = 0 .TextFilePromptOnRefresh = False .TextFilePlatform = 850 .TextFileStartRow = 1 .TextFileParseType = xlDelimited .TextFileTextQualifier = xlTextQualifierDoubleQuote .TextFileConsecutiveDelimiter = False .TextFileTabDelimiter = True .TextFileSemicolonDelimiter = False .TextFileCommaDelimiter = True .TextFileSpaceDelimiter = False .TextFileColumnDataTypes = Array(1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, _ 1, 1) .TextFileTrailingMinusNumbers = True .Refresh BackgroundQuery:=False End With