返回或设置用于 Web 查询的 Web 页的统一资源定位符 (URL)。Variant 类型,可读写。
expression.EditWebPage
expression 必需。该表达式返回“应用于”列表中的对象之一。
如果 EditWebPage 属性没有设置,则返回 Null。只有当查询类型为 Web 或 OLE 时,EditWebPage 属性才有意义。
如果 EditWebPage 不是空值,则忽略用于刷新的 WebTables 属性。因此,XML 查询和 WebTable 属性将引用原始 Web 页中的表,并且只用于编辑情况以预先填充“Web 查询”对话框。
在本示例中,Microsoft Excel 将一个 Web 页的 URL 通知给用户。本示例假定单元格 A1 中的 QueryTable 对象位于活动的工作表上,并且名为“MyhomePage.htm”的文件位于 C:\ 驱动器上。
Sub ReturnURL()
' Set the EditWebPage property to a source.
Range("A1").QueryTable.EditWebPage = "C:\MyHomepage.htm"
' Display the source to the user.
MsgBox Range("A1").QueryTable.EditWebPage
End Sub