Smartgambler
Pro-Punter

Go Back   OZmium Sports Betting and Horse Racing Forums > Public Forums > General Topics
User Name
Password
Register FAQ Search Today's Posts Mark all topics as read

To advertise on these
forums, e-mail us.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 13th February 2013, 10:03 AM
Dennis G Dennis G is offline
Member
 
Join Date: Mar 2006
Posts: 112
Default I'm Stumped with VBA & XML

Hi All,
I'm pulling the hair out and have googled myself silly, but I just can't work this out. I'm hoping Shaun or one of the other Excel experts can help me.

On Sheet2 Cells A3-A10 I have a list of URLs representing one meeting.

A3 =

h**p//tatts.com/pagedata/racing/2013/2/9/BR1.XML
etc

The macro I'm having hassles with -

Code:
Sub LoadRaceDetails() Dim xmldoc As MSXML2.DOMDocument Set xmldoc = New MSXML2.DOMDocument xmldoc.async = False xmldoc.Load ("h**p//tatts.com/pagedata/racing/2013/2/9/BR1.XML")




What I'm trying to achieve is to replace the URL (in blue) with code that will read Sheet2 Cell A3 and then loop to read Cell A4 etc - I'm pretty sure I can handle the looping.....
This XML stuff is doing my head in....

Thanks,
Den

Last edited by Dennis G : 13th February 2013 at 10:06 AM.
Reply With Quote
  #2  
Old 13th February 2013, 01:27 PM
stugots stugots is offline
Banned
 
Join Date: Jan 1970
Posts: 879
Default

not sure on the looping but this will pull the address from A3



Address = Range("A3")

xmldoc.Load Address

Last edited by stugots : 13th February 2013 at 01:29 PM.
Reply With Quote
  #3  
Old 13th February 2013, 02:17 PM
Dennis G Dennis G is offline
Member
 
Join Date: Mar 2006
Posts: 112
Default

Excellent, stugots.
Works brilliantly.

For the rest I altered the code to -

Code:
A = 3 Address = Sheets("Sheet2").Cells(A, 1) xmldoc.Load Address


then at the end of the macro - A = A + 1
so that the next pass A = 4 ie. Cell(A4)

Thanks again, mate
Den
Reply With Quote
  #4  
Old 13th February 2013, 03:26 PM
stugots stugots is offline
Banned
 
Join Date: Jan 1970
Posts: 879
Default

No prob Dennis
Reply With Quote
  #5  
Old 13th February 2013, 03:58 PM
moeee moeee is offline
Suspended
 
Join Date: Jan 1970
Location: Melbourne
Posts: 5,359
Default

Ain't it great when the answer was so simple , yet achieved awsome results for the member.
Reply With Quote
  #6  
Old 13th February 2013, 08:01 PM
Dennis G Dennis G is offline
Member
 
Join Date: Mar 2006
Posts: 112
Default

Quote:
Originally Posted by moeee
Ain't it great when the answer was so simple , yet achieved awsome results for the member.
It sure is mate. I was using web query to download Tatts results, but lately it has taken up to 45 mins to do all meetings on a big saturday.

I've just finished this workbook (bugs not withstanding) just ran it for last saturday and was done in under three minutes.....

Some tweaking to do (not dealing with abandoned meetings too well and some other odd results) but will get there...
Reply With Quote
  #7  
Old 13th February 2013, 08:17 PM
moeee moeee is offline
Suspended
 
Join Date: Jan 1970
Location: Melbourne
Posts: 5,359
Default

Good for you Dennis G
Is that Program adaptable to SuperTab or does the Flash mess it up?
Reply With Quote
  #8  
Old 13th February 2013, 11:00 PM
Dennis G Dennis G is offline
Member
 
Join Date: Mar 2006
Posts: 112
Default

Quote:
Originally Posted by moeee
Good for you Dennis G
Is that Program adaptable to SuperTab or does the Flash mess it up?
I think you're correct about Flash, this only works with XML feeds.

Anyway here it is for your pleasure....
Attached Files
File Type: xlsm Tattsbet Results.xlsm (77.9 KB, 929 views)
Reply With Quote
  #9  
Old 14th February 2013, 08:26 AM
stugots stugots is offline
Banned
 
Join Date: Jan 1970
Posts: 879
Default

Nice one Dennis, if I could make one suggestion, adding the line -

Application.ScreenUpdating = False

as the first line TodaysFields macro speeds it up considerably.


Would also add -

Application.ScreenUpdating = True

as the last line.
Reply With Quote
  #10  
Old 14th February 2013, 11:46 AM
Dennis G Dennis G is offline
Member
 
Join Date: Mar 2006
Posts: 112
Default

Thanks, stugots, that helped a bit.
I'm still in awe of downloading all races on last MC day (107 races) in under 3 minutes.....
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is On
Forum Jump



All times are GMT +10. The time now is 12:22 AM.


Powered by: vBulletin Version 3.0.3
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
©2008 OZmium Pty. Ltd. All rights reserved . ACN 091184655