Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 129
Default How can I use VBA to creat new web query?

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.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,124
Default How can I use VBA to creat new web query?

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.


  #3   Report Post  
Posted to microsoft.public.excel.programming
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.



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,092
Default How can I use VBA to creat new web query?

Destination:=Worksheets("Data").Activecell)

Mike F

"Don Guillett" wrote in message
...
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.




  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 129
Default How can I use VBA to creat new web query?

I have tried working with the Destination to make it the current cell. This
did not work: Destination:=ActiveSheet.Cells(ActiveCell))


"Will" wrote:

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.





  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 129
Default How can I use VBA to creat new web query?

Thanks Mike

But that does not seem to work Here is my full code

With ActiveWorkbook.ActiveSheet _
.QueryTables.Add(Connection:="URL;mytargetpage", _
Destination:=Worksheets("sheet1").ActiveCell)
.BackgroundQuery = True
.TablesOnlyFromHTML = False
.Refresh BackgroundQuery:=False
.SaveData = True
End With


"Mike Fogleman" wrote:

Destination:=Worksheets("Data").Activecell)

Mike F

"Don Guillett" wrote in message
...
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.





  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,092
Default How can I use VBA to creat new web query?

Destination:=.ActiveCell)

We were trying to do things to two different worksheets:
With ActiveWorkbook.ActiveSheet _ 'Activesheet
and then tried to
Destination:=Worksheets("sheet1").ActiveCell) 'Sheet1

Now we need:
With ActiveWorkbook.ActiveSheet _
..QueryTables.Add(Connection:="URL;mytargetpage", _
Destination:=.ActiveCell)

Mike F
"Will" wrote in message
...
Thanks Mike

But that does not seem to work Here is my full code

With ActiveWorkbook.ActiveSheet _
.QueryTables.Add(Connection:="URL;mytargetpage", _
Destination:=Worksheets("sheet1").ActiveCell)
.BackgroundQuery = True
.TablesOnlyFromHTML = False
.Refresh BackgroundQuery:=False
.SaveData = True
End With


"Mike Fogleman" wrote:

Destination:=Worksheets("Data").Activecell)

Mike F

"Don Guillett" wrote in message
...
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.






  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,092
Default How can I use VBA to creat new web query?

That didn't work either under testing, but this did:

Dim rng As Range
Set rng = ActiveCell
With ActiveWorkbook.ActiveSheet _
.QueryTables.Add(Connection:="URL;mytargetpage", _
Destination:=rng)
.BackgroundQuery = True
.TablesOnlyFromHTML = False
.Refresh BackgroundQuery:=False
.SaveData = True
End With

Mike F
"Mike Fogleman" wrote in message
m...
Destination:=.ActiveCell)

We were trying to do things to two different worksheets:
With ActiveWorkbook.ActiveSheet _ 'Activesheet
and then tried to
Destination:=Worksheets("sheet1").ActiveCell) 'Sheet1

Now we need:
With ActiveWorkbook.ActiveSheet _
.QueryTables.Add(Connection:="URL;mytargetpage", _
Destination:=.ActiveCell)

Mike F
"Will" wrote in message
...
Thanks Mike

But that does not seem to work Here is my full code

With ActiveWorkbook.ActiveSheet _
.QueryTables.Add(Connection:="URL;mytargetpage", _
Destination:=Worksheets("sheet1").ActiveCell)
.BackgroundQuery = True
.TablesOnlyFromHTML = False
.Refresh BackgroundQuery:=False
.SaveData = True
End With


"Mike Fogleman" wrote:

Destination:=Worksheets("Data").Activecell)

Mike F

"Don Guillett" wrote in message
...
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.








  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 129
Default How can I use VBA to creat new web query?

Mike - Thanks. That did it.

"Mike Fogleman" wrote:

That didn't work either under testing, but this did:

Dim rng As Range
Set rng = ActiveCell
With ActiveWorkbook.ActiveSheet _
.QueryTables.Add(Connection:="URL;mytargetpage", _
Destination:=rng)
.BackgroundQuery = True
.TablesOnlyFromHTML = False
.Refresh BackgroundQuery:=False
.SaveData = True
End With

Mike F
"Mike Fogleman" wrote in message
m...
Destination:=.ActiveCell)

We were trying to do things to two different worksheets:
With ActiveWorkbook.ActiveSheet _ 'Activesheet
and then tried to
Destination:=Worksheets("sheet1").ActiveCell) 'Sheet1

Now we need:
With ActiveWorkbook.ActiveSheet _
.QueryTables.Add(Connection:="URL;mytargetpage", _
Destination:=.ActiveCell)

Mike F
"Will" wrote in message
...
Thanks Mike

But that does not seem to work Here is my full code

With ActiveWorkbook.ActiveSheet _
.QueryTables.Add(Connection:="URL;mytargetpage", _
Destination:=Worksheets("sheet1").ActiveCell)
.BackgroundQuery = True
.TablesOnlyFromHTML = False
.Refresh BackgroundQuery:=False
.SaveData = True
End With


"Mike Fogleman" wrote:

Destination:=Worksheets("Data").Activecell)

Mike F

"Don Guillett" wrote in message
...
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.









Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
creat a pop up box delete automatically Excel Discussion (Misc queries) 10 April 20th 08 03:53 PM
Pls help for creat a Macro.... John Excel Discussion (Misc queries) 4 January 31st 08 08:29 PM
Creat dsanita Excel Discussion (Misc queries) 0 July 25th 06 10:01 PM
How can I creat NYExcel Excel Discussion (Misc queries) 2 April 17th 06 04:39 PM
Creat a new worksheet lashio Excel Discussion (Misc queries) 4 April 25th 05 03:40 AM


All times are GMT +1. The time now is 07:59 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"