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
  #51  
Old 14th December 2012, 09:10 AM
Martinw Martinw is offline
Member
 
Join Date: May 2012
Posts: 40
Default

I am trying to update my webquery to MSXML2.XMLHTTP using the code in this posting

I have tried to modify it as below:-

Dim WA As String

Sub queryhtml(wks As Worksheet)

WA = wks.Range("AF1").Value
Formhtml = ExecuteWebRequest(WA)

It will not run the Formhtml function; just skips it and exits the sub.

Any help would be greatly appreciated as I am completely out of my depth here.

Ta,
Martin
Reply With Quote
  #52  
Old 14th December 2012, 01:53 PM
Shaun Shaun is offline
Member
 
Join Date: Jan 1970
Location: Western Australia
Posts: 3,456
Default

If you post the whole code for that macro i might be able to see where the issue is.

Post it with code tags thanks.
__________________
One Drive

"If the corporates are treating you poorly , just go elsewhere."
"If they need you , they will soon find out."
"If you need them , you will soon find out."
--moeee
_______________________________________________
Reply With Quote
  #53  
Old 14th December 2012, 03:51 PM
Martinw Martinw is offline
Member
 
Join Date: May 2012
Posts: 40
Default

Hi


Sub queryhtml(wks As Worksheet)
Dim WA As String
WA = wks.Range("AF1").Value



Formhtml = ExecuteWebRequest(WA) ' runs the first function.

outputtext (Formhtml) 'gets the contents held in the file created by the second function

Set Temp_qt = wks.QueryTables.Add(Connection:=WA, Destination:=wks.Range("BA1")) ' creates the link from the tx doc to the sheet.

With Temp_qt
.Name = False
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.BackgroundQuery = True
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = False
.RefreshPeriod = 0
.WebSelectionType = xlEntirePage
.WebFormatting = xlWebFormattingNone
.WebPreFormattedTextToColumns = True
.WebConsecutiveDelimitersAsOne = True
.WebSingleBlockTextImport = False
.WebDisableDateRecognition = False
.WebDisableRedirections = False
.Refresh BackgroundQuery:=False
End With

' wks.QueryTables.Item(1).Delete

' Set Temp_qt = Nothing
Kill ThisWorkbook.Path & "\temp.txt" 'deletes the temp txt file.
' If ThisWorkbook.Connections.Count > 0 _
' Then ThisWorkbook.Connections.Item(ThisWorkbook.Connect ions.Count).Delete 'deletes any left over connections.

End Sub
Reply With Quote
  #54  
Old 14th December 2012, 03:59 PM
Martinw Martinw is offline
Member
 
Join Date: May 2012
Posts: 40
Default

Whoops forgot the wordy bits

wks. is because I run the same code on multiple sheets - 1 for each race up to 70 a day. So instead of writing Range("AF1").Value I write wks.Range("AF1").Value and that tells the computer to work on the current sheet. I use OnTime to do the timing. Each minute it checks each sheet to see if it needs to be updated and if so runs the code.

The first step is download the data and as Tatts xml is not updating properly I am using web query. But the old TABonline page will not stay up forever so want to modify yr code so I can get it off the Tatts page. And then maybe NSW

Ta,
Martin
Reply With Quote
  #55  
Old 14th December 2012, 10:27 PM
Shaun Shaun is offline
Member
 
Join Date: Jan 1970
Location: Western Australia
Posts: 3,456
Default

I am not the best at reading code to find issues but have you tried running in debug mode?

Open your code page and position the cursor at the start then select debug then every time you press F8 it will run one line of code and you will see where at goes and you can even look at your sheet to see the outcome.

If it is crashing on the formhtml at usually means the web address returned an erro so just for a test copy the actual web address from the web page you after and past it between the bracket and between "" these.

If when you run it again in debug it does what it should then the issue is in your web address.

As far as using Taboline site you should have no issues except i find it slower than the old site, takes about 5 to 10 seconds to import as the old site takes about 3 seconds or less.

I have no idea with the new NSW/Vic sites as i can't convert the new code to what i know.
__________________
One Drive

"If the corporates are treating you poorly , just go elsewhere."
"If they need you , they will soon find out."
"If you need them , you will soon find out."
--moeee
_______________________________________________
Reply With Quote
  #56  
Old 14th December 2012, 11:49 PM
Martinw Martinw is offline
Member
 
Join Date: May 2012
Posts: 40
Default

Just had another try and it gets to oXHTTP.send in the Public Function ExecuteWebRequest and then exits - does not go onto ExecuteWebRequest = oXHTTP.responseText
Reply With Quote
  #57  
Old 17th December 2012, 05:24 PM
Martinw Martinw is offline
Member
 
Join Date: May 2012
Posts: 40
Default

Got it working but found tatts to be very slow. Tried there xml feed again and still getting 30% error rate. So will stick with what I have for now and try to get into NSW's xml. This exercise has given me a few hints about that
Reply With Quote
  #58  
Old 18th December 2012, 06:07 AM
norisk norisk is offline
Member
 
Join Date: Dec 2011
Posts: 334
Default

I was of the belief that the XML feeds from NSW & Vic sites will no longer be available once the old sites are shut down, which as it happens is today.

Old sites are gone & none of my Vic code is working so I guess that's that...
__________________
"Now let me get this straight - Whatever I do don't bet this horse?"
Reply With Quote
  #59  
Old 18th December 2012, 10:28 AM
Shaun Shaun is offline
Member
 
Join Date: Jan 1970
Location: Western Australia
Posts: 3,456
Default

Yes, unless you use there new service, but importunately even they don't know how to use it.
__________________
One Drive

"If the corporates are treating you poorly , just go elsewhere."
"If they need you , they will soon find out."
"If you need them , you will soon find out."
--moeee
_______________________________________________
Reply With Quote
  #60  
Old 18th December 2012, 02:35 PM
Martinw Martinw is offline
Member
 
Join Date: May 2012
Posts: 40
Default

Re Shawns's post
Well that's encouraging!
I tried reading the Live Odds book again last night. Rather vague to a person of my limited skill. But then then whole xml thing seems to be like that. Reading all the various pages there is lots of data but even the pro's seem to struggle to make it work.
I am hoping that the Tatt's page, http://www.tabonline.com.au, stays up until they get their xml back on track. I really miss their xml feed it was so sweet and simple even I could use it. Still I have recorded every race today so far of tabonline and will get the balance and it is running fine.

Ta,
Martin
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 06:10 AM.


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