Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default dynamic web queries with vba


Hello,

I am trying to create multiple web queries where I pull in data in fro
a url where I have the urls (around 10 of them) in an excel workbook.

Any help would be hugely appreciated.

thanks

Rand

--
rbarnin
-----------------------------------------------------------------------
rbarning's Profile: http://www.excelforum.com/member.php...fo&userid=3778
View this thread: http://www.excelforum.com/showthread.php?threadid=57354

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default dynamic web queries with vba

Dear Randy

Did you ever solve this problem?

I am trying to do the same thing with about 200 different web pages and
am curious to know what your VBA script looks to do your action.

Regards
Pelham

rbarning wrote:
Hello,

I am trying to create multiple web queries where I pull in data in from
a url where I have the urls (around 10 of them) in an excel workbook.

Any help would be hugely appreciated.

thanks

Randy


--
rbarning
------------------------------------------------------------------------
rbarning's Profile: http://www.excelforum.com/member.php...o&userid=37787
View this thread: http://www.excelforum.com/showthread...hreadid=573544


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default dynamic web queries with vba


Yes I did.
You can name the url as a parameter, I called it x.
I did the range by multiplying the for next loop number by 200.
I'm sure it is not the best code, but it works pretty good.

Sub aaa()

Dim x As String
Dim webq As Integer

For webq = 1 To range("F1")

x = range("D" & webq)

With ActiveSheet.QueryTables.Add(Connection:= _
"URL;" & x, _
Destination:=range("C" & webq * 200))
.Name = "gamelog?playerId=4234"
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.BackgroundQuery = True
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.WebSelectionType = xlSpecifiedTables
.WebFormatting = xlWebFormattingNone
.WebTables = "1,5"
.WebPreFormattedTextToColumns = True
.WebConsecutiveDelimitersAsOne = True
.WebSingleBlockTextImport = False
.WebDisableDateRecognition = False
.WebDisableRedirections = False
.Refresh BackgroundQuery:=False
End With



application.CutCopyMode = False

Next webq

End Sub



Pelham Wrote:
Dear Randy

Did you ever solve this problem?

I am trying to do the same thing with about 200 different web page
and
am curious to know what your VBA script looks to do your action.

Regards
Pelha


--
rbarnin
-----------------------------------------------------------------------
rbarning's Profile: http://www.excelforum.com/member.php...fo&userid=3778
View this thread: http://www.excelforum.com/showthread.php?threadid=57354

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default dynamic web queries with vba

Wonderful people - thanks!

rbarning wrote:
Yes I did.
You can name the url as a parameter, I called it x.
I did the range by multiplying the for next loop number by 200.
I'm sure it is not the best code, but it works pretty good.

Sub aaa()

Dim x As String
Dim webq As Integer

For webq = 1 To range("F1")

x = range("D" & webq)

With ActiveSheet.QueryTables.Add(Connection:= _
"URL;" & x, _
Destination:=range("C" & webq * 200))
.Name = "gamelog?playerId=4234"
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.BackgroundQuery = True
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.WebSelectionType = xlSpecifiedTables
.WebFormatting = xlWebFormattingNone
.WebTables = "1,5"
.WebPreFormattedTextToColumns = True
.WebConsecutiveDelimitersAsOne = True
.WebSingleBlockTextImport = False
.WebDisableDateRecognition = False
.WebDisableRedirections = False
.Refresh BackgroundQuery:=False
End With



application.CutCopyMode = False

Next webq

End Sub



Pelham Wrote:
Dear Randy

Did you ever solve this problem?

I am trying to do the same thing with about 200 different web pages
and
am curious to know what your VBA script looks to do your action.

Regards
Pelham



--
rbarning
------------------------------------------------------------------------
rbarning's Profile: http://www.excelforum.com/member.php...o&userid=37787
View this thread: http://www.excelforum.com/showthread...hreadid=573544


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default dynamic web queries with vba

Randy,
Record a macro when you create 1 web query.
Modify the code to change the URL and Destination within a loop

NickHK

"rbarning" wrote in
message ...

Hello,

I am trying to create multiple web queries where I pull in data in from
a url where I have the urls (around 10 of them) in an excel workbook.

Any help would be hugely appreciated.

thanks

Randy


--
rbarning
------------------------------------------------------------------------
rbarning's Profile:

http://www.excelforum.com/member.php...o&userid=37787
View this thread: http://www.excelforum.com/showthread...hreadid=573544





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
Help: Creating dynamic sql queries in excel [email protected] Excel Programming 1 August 28th 06 09:43 PM
Help with copying dynamic column selected based on remote cell value and dynamic formula fill ers Excel Programming 0 March 1st 06 01:05 AM
Dynamic Range with unused formula messing up x axis on dynamic graph [email protected] Charts and Charting in Excel 2 February 2nd 06 08:02 PM
Dynamic Web Queries Chuck Taylor Excel Programming 1 January 27th 04 04:27 AM
Dynamic Web Queries Matt Day Excel Programming 3 January 27th 04 03:48 AM


All times are GMT +1. The time now is 12:21 PM.

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"