返回或设置正向查询表中导入的文本文件的原始格式。本属性确定在数据导入过程中使用何种代码页。默认值是在“文本导入向导”的“原始数据类型”选项中的当前设置。XlPlatform 类型,可读写。
XlPlatform 可为以下 XlPlatform 常量之一。 |
xlMacintosh |
xlMSDOS |
xlWindows |
expression.TextFilePlatform
expression 必需。该表达式返回“应用于”列表中的对象之一。
只有当查询表是基于文本文件中的数据(QueryType 属性设置为 xlTextImport)时,才使用本属性。
本示例向第一个工作簿中第一张工作表上的查询表中导入一个 MS-DOS 文本文件,然后刷新该查询表。
Set shFirstQtr = Workbooks(1).Worksheets(1)
Set qtQtrResults = shFirstQtr.QueryTables _
.Add(Connection := "TEXT;C:\My Documents\19980331.txt", _
Destination := shFirstQtr.Cells(1,1))
With qtQtrResults
.TextFilePlatform = xlMSDOS
.TextFileParseType = xlDelimited
.TextFileTabDelimiter = True
.Refresh
End With