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

返回或设置指定工作表中的行的添加或删除方式, 以适应查询返回的 recordset 中的行数。Returns or sets the way rows on the specified worksheet are added or deleted to accommodate the number of rows in a recordset returned by a query. 读/写**XlCellInsertionMode**。Read/write XlCellInsertionMode.



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


如果使用用户界面导入数据, 则会将来自 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.

您可以使用ListObject的查询表属性来访问RefreshStyle属性。 You can use the QueryTable property of the ListObject to access the RefreshStyle property.


本示例向 Sheet1 中添加一个查询表。This example adds a query table to Sheet1. RefreshStyle属性根据需要向工作表添加行, 以容纳数据结果。The RefreshStyle property adds rows to the worksheet as needed, to hold the data results.

Dim qt As QueryTable 
Set qt = Sheets("sheet1").QueryTables _ 
 .Add(Connection:="Finder;c:\myfile.dqy", _ 
With qt 
 .RefreshStyle = xlInsertEntireRows 
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.