+ Reply to Thread
Results 1 to 5 of 5

Web Query

  1. #1
    ExcelMonkey
    Guest

    Web Query

    Is it possible in VBA to check a cell range and test to
    see if it is the desigated cell for a web query. That is
    I want to be able to identify which cell the web query
    pastes to.

    Thanks

  2. #2
    Don Guillett
    Guest

    Re: Web Query

    If you need for your refresh macro,why not just use

    sheets("mysheet").querytables(1).refresh

    --
    Don Guillett
    SalesAid Software
    [email protected]
    "ExcelMonkey" <[email protected]> wrote in message
    news:[email protected]...
    > Is it possible in VBA to check a cell range and test to
    > see if it is the desigated cell for a web query. That is
    > I want to be able to identify which cell the web query
    > pastes to.
    >
    > Thanks




  3. #3
    K Dales
    Guest

    RE: Web Query

    If there is a web query, the results will be in a QueryTable on the sheet;
    and the QueryTable.QueryType will be xlWebQuery - so, for example:

    Dim QT as QueryTable
    For Each QT in ActiveSheet.QueryTables
    If Not(Intesect(RangeToCheck,QT.ResultRange) Is Nothing) And _
    QT.QueryType = xlWebQuery Then MsgBox QT. Name & ": " & QT.Connection
    Next QT


    "ExcelMonkey" wrote:

    > Is it possible in VBA to check a cell range and test to
    > see if it is the desigated cell for a web query. That is
    > I want to be able to identify which cell the web query
    > pastes to.
    >
    > Thanks
    >


  4. #4
    Jake Marx
    Guest

    Re: Web Query

    Hi ExcelMonkey,

    ExcelMonkey wrote:
    > Is it possible in VBA to check a cell range and test to
    > see if it is the desigated cell for a web query. That is
    > I want to be able to identify which cell the web query
    > pastes to.


    Each worksheet contains a QueryTables collection. Code like this will give
    you the destination range address of a particular QueryTable:

    Debug.Print Sheet1.QueryTables(1).Destination.Address

    QueryTables can either be web or database driven. If it's a web query, the
    following statement should evaluate to True:

    Sheet1.QueryTables(1).Connection Like "URL;*"

    --
    Regards,

    Jake Marx
    MS MVP - Excel
    www.longhead.com

    [please keep replies in the newsgroup - email address unmonitored]


  5. #5
    Jake Marx
    Guest

    Re: Web Query

    Jake Marx wrote:
    > QueryTables can either be web or database driven. If it's a web
    > query, the following statement should evaluate to True:
    >
    > Sheet1.QueryTables(1).Connection Like "URL;*"


    Please look at K Dales' post for a better way to do this (QueryType
    property).

    --
    Regards,

    Jake Marx
    MS MVP - Excel
    www.longhead.com

    [please keep replies in the newsgroup - email address unmonitored]


+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1