EditWebPage Property

Microsoft Excel Visual Basic

Show All

EditWebPage Property

       

Returns or sets the web page Uniform Resource Locator (URL) for a web query. Read/write Variant.

expression.EditWebPage

expression   Required. An expression that returns one of the objects in the Applies To list.

Remarks

The EditWebPage property returns Null if not set. The EditWebPage property is only meaningful if the query type is Web or OLE.

If the EditWebPage is not null then ignore the WebTables property for refreshing. As a result an XML query and the WebTable property refers to the table in the original Web page and should only be used in the edit case to pre-populate the Web Query dialog box.

Example

In this example, Microsoft Excel notifies the user a web page URL. This example assumes a QueryTable object in cell A1 exists in the active worksheet and that file called "MyHomepage.htm" exists on the C:\ drive.

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