WebConsecutiveDelimitersAsOne 属性 (Excel)QueryTable.WebConsecutiveDelimitersAsOne property (Excel)

如此如果将数据从网页上的 HTML <PRE>标记导入查询表中时, 如果将连续分隔符视为单个分隔符, 并且要将数据解析为列。True if consecutive delimiters are treated as a single delimiter when you import data from HTML <PRE> tags on a webpage into a query table, and if the data is to be parsed into columns. 如果将连续多个分隔符看作多个分隔符,则该值为 FalseFalse if you want to treat consecutive delimiters as multiple delimiters. 默认值为 TrueThe default value is True. 读取/写入 BooleanRead/write Boolean.

语法Syntax

表达式WebConsecutiveDelimitersAsOneexpression.WebConsecutiveDelimitersAsOne

_表达式_一个代表查询表对象**** 的变量。expression A variable that represents a QueryTable object.

注解Remarks

仅当查询表的**QueryType** 属性设置为xlWebQuery, 查询返回 HTML 文档, 并且**WebPreFormattedTextToColumns** 属性设置为True时, 才使用此属性。Use this property only when the query table's QueryType property is set to xlWebQuery, the query returns an HTML document, and the WebPreFormattedTextToColumns property is set to True.

如果使用用户界面导入数据, 则会将来自 web 查询或文本查询的数据作为一个查询表**** 对象导入, 而将所有其他外部数据作为**ListObject** 对象导入。If you import data by using the user interface, data from a web query or a text query is imported as a QueryTable object, while all other external data is imported as a ListObject object.

如果使用对象模型导入数据, 则必须将来自 web 查询或文本查询的数据作为查询表导入****, 而所有其他外部数据均可作为ListObject或查询表导入。 ****If you import data by using the object model, data from a web query or a text query must be imported as a QueryTable, while all other external data can be imported as either a ListObject or a QueryTable.

WebConsecutiveDelimitersAsOne 属性仅适用于 QueryTable 对象。The WebConsecutiveDelimitersAsOne property applies only to QueryTable objects.

示例Example

本示例将第一个工作簿中第一张工作表上的查询表的分隔符设置为空格字符,然后刷新该查询表。This example sets the space character to be the delimiter in the query table on the first worksheet in the first workbook, and then it refreshes the query table. 连续多个空格作为单个空格处理。Consecutive spaces are treated as a single space.

Set shFirstQtr = Workbooks(1).Worksheets(1) 
Set qtQtrResults = shFirstQtr.QueryTables _ 
 .Add(Connection := "URL;https://datasvr/98q1/19980331.htm", _ 
 Destination := shFirstQtr.Cells(1,1)) 
With qtQtrResults 
 .WebConsecutiveDelimitersAsOne = True 
 .Refresh 
End With

支持和反馈Support and feedback

有关于 Office VBA 或本文档的疑问或反馈?Have questions or feedback about Office VBA or this documentation? 请参阅 Office VBA 支持和反馈,获取有关如何接收支持和提供反馈的指南。Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.