返回或设置一个值,用于确定向查询表中导入 Web 页时,Web 页中有多少格式被应用。XlWebFormatting 类型,可读写。
XlWebFormatting 可为以下 XlWebFormatting 常量之一。 |
xlWebFormattingAll |
xlWebFormattingRTF |
xlWebFormattingNone 默认值。 |
expression.WebFormatting
expression 必需。该表达式返回“应用于”列表中的对象之一。
只有当查询表的 QueryType 属性设置为 xlWebQuery 且该查询返回一个 HTML 文档时,才使用本属性。
本示例在第一个工作簿中第一张工作表上添加一个新的 Web 查询表,并导入应用于数据的所有 Web 页格式,然后刷新该查询表。
Set shFirstQtr = Workbooks(1).Worksheets(1)
Set qtQtrResults = shFirstQtr.QueryTables _
.Add(Connection := "URL;http://datasvr/98q1/19980331.htm", _
Destination := shFirstQtr.Cells(1,1))
With qtQtrResults
.WebFormatting = xlAll
.Refresh
End With