Name

querytable.EditWebPage [= setting]

Synopsis

Sets or returns the address of the web page used by the Edit Web Query dialog box. EditWebPage is ignored for non-web queries (QueryType is not xlWebQuery).

For example, the following code performs a web query getting a quote for a specific stock, but displays the general financial page if the user decides to edit the web query:

    Set ws = ActiveSheet
    strConn = "URL;http://finance.yahoo.com/q/ecn?s=dell"
    Set qt = ws.QueryTables.Add(strConn, [QueryDestination])
    qt.EditWebPage = "http://finance.yahoo.com/"
    qt.Refresh

Get Programming Excel with VBA and .NET now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.