Home |
Search |
Today's Posts |
|
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
Web Query
If you need for your refresh macro,why not just use
sheets("mysheet").querytables(1).refresh -- Don Guillett SalesAid Software "ExcelMonkey" wrote in message ... 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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Import New Database Query (Union Query) in Spreadsheet | Excel Discussion (Misc queries) | |||
Convert hard coded query criteria to Parameter Query | Excel Discussion (Misc queries) | |||
Excel 2007 / MS Query - editing existing query to another sheet | Excel Discussion (Misc queries) | |||
Importing Data via Web Query - Can values be passed to query? | Excel Discussion (Misc queries) | |||
Stop to modify the SQL query manually entered into query ! | Excel Programming |