#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Web Queries

Within Microsoft Excel you can leverage the Web Query dialog to retrieve
information from a web pagae and place it in a spreadsheet. I have two
questionsL

1. Can this be done via a function or macro call?

2. If not can the URL associated with the web page by dynamic, allowing you
to reference a cell which would contain the string you want leveraged?
Enabling you to change parameters based upon other cell contents.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 21
Default Web Queries

Hi Rob,

Is something like this what you're after ...

Sub Create_Web_QueryTables()
Dim strCnn As String
strCnn =
"URL;http://investing.reuters.co.uk/Stocks/Quote.aspx?symbol=RTR.L"
With ActiveSheet.QueryTables.Add(Connection:=strCnn,
Destination:=Range("A3"))
.Name = "WebQueryTest"
.FieldNames = True
.RefreshStyle = xlInsertEntireRows
.HasAutoFormat = False
.WebFormatting = xlWebFormattingNone
.WebSelectionType = xlSpecifiedTables
.WebTables = "25"
.RefreshOnFileOpen = True
.Refresh
End With
End Sub

In order to make it 'dynamic', change the line strCnn = "URL;http://..." to

strnCnn = "URL;" & Range("A1").Text

and ensure that the full URL is correctly entered into worksheet cell A1
before calling the macro. (You should also change the destination cell
when/if creating a new querytable).

HTH, Sean.

"Rob Krugman" wrote:

Within Microsoft Excel you can leverage the Web Query dialog to retrieve
information from a web pagae and place it in a spreadsheet. I have two
questionsL

1. Can this be done via a function or macro call?

2. If not can the URL associated with the web page by dynamic, allowing you
to reference a cell which would contain the string you want leveraged?
Enabling you to change parameters based upon other cell contents.

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
using web queries M-Kells Excel Discussion (Misc queries) 3 June 3rd 08 01:50 PM
Web queries Heine Excel Worksheet Functions 2 December 7th 06 02:43 PM
SQL Queries AL Excel Worksheet Functions 0 February 2nd 06 09:20 PM
Web Queries Louise Excel Worksheet Functions 1 October 24th 05 04:03 PM
Queries Bean123r Excel Discussion (Misc queries) 0 June 17th 05 12:15 AM


All times are GMT +1. The time now is 10:33 AM.

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

About Us

"It's about Microsoft Excel"