View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Will Will is offline
external usenet poster
 
Posts: 129
Default How can I use VBA to creat new web query?

Thanks that helps a lot.

This puts the table in A1 of the sheet "Data", can it be adapted to the
current selected cell?

"Don Guillett" wrote:

Here's an example

With ActiveWorkbook.Worksheets("Data").QueryTables.Add( _
Connection:="URL;" & your_url,
Destination:=Worksheets("Data").Cells(1, 1))
.BackgroundQuery = True
.TablesOnlyFromHTML = False
.Refresh BackgroundQuery:=False
.SaveData = True
End With

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Will" wrote in message
...
I need to build an addin application that creates a brand new web query in
the target cell / cell range. I know how to modify, refresh, but not
create
a brand new query. I intend to provide a choice of several data page
queries.