Log in

View Full Version : TattsDownloads


Martinw
9th January 2014, 09:45 AM
I am trying to add the win pool to some code that I got off this site that was written by Shaun with my failed attempt at the bottom.

I just want to add the win and place pools in, or around, cell O1 and then add the meeting name to cell C3

Any help would be greatly appreciated.

Ta,
Martin

aussielongboat
9th January 2014, 10:41 AM
Tatts changed their web access a couple of years ago and you may have some problems downloading what you want.

now, in most cases, you need to use the XML access

Martinw
9th January 2014, 11:26 AM
Hi Aussie,

It is the xml code I am accessing - look at the address in cell E1

They still have the tabonline.com.au page up which is where I am getting my html feed from

But I want to check to see if the xml feed is now staying up to date with divs and pools - last time I checked it was often way behind their web page and the html feeds.

Ta,
Martin

aussielongboat
9th January 2014, 12:39 PM
Hi Aussie,

It is the xml code I am accessing - look at the address in cell E1

They still have the tabonline.com.au page up which is where I am getting my html feed from

But I want to check to see if the xml feed is now staying up to date with divs and pools - last time I checked it was often way behind their web page and the html feeds.

Ta,
Martin

where's the file

aussielongboat
9th January 2014, 12:40 PM
can you attach a copy of the file so we are both singing from the same hymn sheet please and i will have a gander at it

Martinw
9th January 2014, 12:59 PM
whoops I thought I had attached it. will try again
forgot to hit the upload button...........

Ta,
Martin

walkermac
9th January 2014, 03:10 PM
How about this?

Lord Greystoke
9th January 2014, 03:14 PM
How about this?G'day walkermac, any chance you could post one in the older version of excel(.xls) ??

LG

walkermac
9th January 2014, 03:19 PM
It complained about some conversion issues - hopefully they're just stylistic.

Lord Greystoke
9th January 2014, 03:36 PM
Ta mate

LG

Lord Greystoke
9th January 2014, 03:55 PM
Holy hot-cakes walkermac.. it works!

Cheers LG

Martinw
9th January 2014, 04:08 PM
That's great - works for me too. Now I can check out the xml data and compare to their webpage. And hopefully go from html to xml

Thanks for all the help

Ta,
Martin

walkermac
9th January 2014, 04:32 PM
No worries folks.

Martinw
9th January 2014, 04:45 PM
Have been comparing between this and their webpage and html and it is looking very excellent. So now I can update my app.

Thanks again for the help.

Ta,
Martin

Martinw
9th January 2014, 05:02 PM
I am having a problem moving the code to my app.

When I try to compile it comes up "argument not optional" on Set Pool = poolList.Item(J) - it does not like "Pool"

Note I am calling this from a multisheet app - so I have changed all the "Sheet1" to wks (wks as worksheet) as this is what my app uses.

Any help would be greatly appreciated.

I have put the code in a blank wkbk cause my app is huge

Ta,
Martin

Lord Greystoke
9th January 2014, 07:27 PM
Are you guys working on getting historical results (or have them already) as well or is it still on the TO DO list?

Cheers LG

Martinw
9th January 2014, 07:46 PM
no, I am working on getting current downloads of divs for races happening now

Ta,
Martin

walkermac
9th January 2014, 08:54 PM
Sorry, but it works fine at my end. I just added a button to a blank worksheet that called LoadRaceField(ActiveSheet) on being pressed, changed the xml address from cell E-whatever to a string and added a reference Microsoft XML v6.0 (which I presume you've done, as it would've fallen over much earlier).

Code ran through and wrote the odds for the race onto the worksheet; no problems.

If it's still not working for you, maybe upload the whole workbook someplace else and I can have a look to whatever is unique to your situation. ...you haven't done something silly and defined your own function/subroutine called Item, have you?

Martinw
9th January 2014, 11:40 PM
I have uploaded my Personal wkbk - all 350 odd modules of really badly written code! I have been writing and using it since Feb 2002 - every day.

The Public Sub LoadRaceField(wks As Worksheet) is on mod 104. It showing on OZmium so you should be able to upload it. It is 7828kb

I put the sub in a separate wkbk by itself and it compiled no problem. But not in my Personal wkbk.

Any help you can offer would be greatly appreciated. Now 240am so must go to bed.

Ta,
Martin

Martinw
9th January 2014, 11:46 PM
Forgot to mention that the sub is now a public sub with .wks as worksheet. And I have changed the cell references around to fit my workbooks - I download up to 70 races a day.

Ta,
Martin

aussielongboat
10th January 2014, 05:53 AM
the full days download
go to sheet 3 and put the date in cells b1 to d1
invoke macro by clicking " prices and results" button
days program data on sheet 1 - doesn't show jockey or barrier though
days results W&P in sheet 4

i then link to another spreadsheet you can then pick up into another spreadsheet

Lord Greystoke
10th January 2014, 06:51 AM
the full days download
go to sheet 3 and put the date in cells b1 to d1
invoke macro by clicking " prices and results" button
days program data on sheet 1 - doesn't show jockey or barrier though
days results W&P in sheet 4

i then link to another spreadsheet you can then pick up into another spreadsheetUp s creek here without a long boat or a paddle - just opened the 2nd version and pressed the Prices & Results button...

Run time error 438
Object doesn't support this property or method

Don't you just hate it when that happens??

LG

Martinw
10th January 2014, 06:53 AM
Hi Aussie - thanks for that.

Unforetunetly it does not fix my problem. My app automatically downloads the divs and win pools at preset intervals for 30 mins up to the gate closing. It does this on up to 70 works sheets a day depending on how many races there are. It then runs an analytical package to see if each race is a bet or not.
Over the years I have focused on the analytical package. I was using xml schemas to get the xml feed but when Tatts took over the downloads got very shonky. So I went back to html. Now I have some time I am trying to get back to xml feed.
The problem is Shaun's code is for a single sheet, mine is multiple sheets. And I am not a good programmer. So when an error message comes up I tend to hit the wall. I did manage to get the race number to load - do not ask me how!
But now I need to get "Pool" to become an optional argument. This is not a problem as a single sheet app but multisheet is a no go.

Ta,
Martin

Martinw
10th January 2014, 06:57 AM
Hi Lord,

By 2nd I take it you mean the '97 version, sounds like something is either not supported or not loaded in Tools, References of your version of xl.

Other than that.....up the same creek.

Ta,
Martin

aussielongboat
10th January 2014, 07:31 AM
yes it seems like a few references have to be opened.
i have attached a picture of what they should be:

http://www.flickr.com/photos/21663999@N00/11860354115/

aussielongboat
10th January 2014, 07:48 AM
yes it seems like a few references have to be opened.
i have attached a picture of what they should be:

http://www.flickr.com/photos/21663999@N00/11860354115/

right click and open in a new tab.
i couldnt post a picture

Martinw
10th January 2014, 08:03 AM
Thanks Aussie,

I have all of those opened. I also had a bunch of soaps open which I have now closed. Plus I have MD Forms 2.0 Object Library which I cannot close as it is being used whereas you have it closed.

Ta,
Martin

aussielongboat
10th January 2014, 08:28 AM
Thanks Aussie,

I have all of those opened. I also had a bunch of soaps open which I have now closed. Plus I have MD Forms 2.0 Object Library which I cannot close as it is being used whereas you have it closed.

Ta,
Martin


and you are using office 2010 or 2007

another way would be for you to copy each macro into your own version of excel and step by step through it to see what happens.

i don't recall doing anything overly fancy

Martinw
10th January 2014, 08:35 AM
I am in 2010. I have copied it into my own wkbk but not happening. The step by step thing would be a huge exercise even with only a 10 race book. I really need to get the thing to compile first and that means getting past the issue with it not accepting the pool issue.

Ta.
Martin

aussielongboat
10th January 2014, 09:09 AM
I am in 2010. I have copied it into my own wkbk but not happening. The step by step thing would be a huge exercise even with only a 10 race book. I really need to get the thing to compile first and that means getting past the issue with it not accepting the pool issue.

Ta.
Martin
ok strip out what you don't want me to see and upload a copy of your workbook and i will see if i can get it to work.

cheers

aussie

Martinw
10th January 2014, 10:21 AM
Will do, may take a while to do the stripping

Ta,
Martin

Martinw
10th January 2014, 10:28 AM
On second thoughts don't worry about it. It will take me hours to try and condense the code down to something sensible. It currently has both the html and the old schema download tools in it which makes it complicated.

Really all I need to know is why the compiler is rejecting "pool" when it accepts "runner" doing the same thing.

I will do some more research and possible try the xml pages.

Thanks for your help Aussie. I will post my solution when I get there.

Ta,
Martin

aussielongboat
10th January 2014, 10:53 AM
ok good luck

Martinw
10th January 2014, 11:05 AM
Thanks I need it - time spent in forums so often just reminds me of how tragic life really is........

walkermac
10th January 2014, 11:54 AM
Why I got out of the IT industry reason #googleplex.

Rename pool to poolb. Or simon. Or anything. 'Pool' must be the name of a some function or data type that has been included amongst the references in this project that wasn't included in the other.

...how the heck is this thing supposed to run anyway? I could only figure out how to test the code by removing the paramater for LoadRaceFields (and setting wks explicitly) so I could run it as a macro.

Martinw
10th January 2014, 01:15 PM
Thanks Walkermac - it now compiles. Now I just have to merge it with the rest of the monster and hopefully I can go back to xml feed
I have attached a file - look at module 2. It has the timer sub from which the beast fires. At preset intervals it gets updates and after the last download it runs an analytical package which tells me whether or not to bet. when i started it in 2001 I never thought it was going to be this big.

Thanks again for your help

Ta,
Martin

ps I will probably be back to beg more help.....

walkermac
10th January 2014, 01:25 PM
No worries. Don't count on me though! My knowledge is pretty dated :)

(incidentally, I always wondered why it was convention to use a lowercase letter to begin variable names: e.g. thisIsMyVariable, vs ThisIsMyFunction. Had you followed this convention you would've known something was up when 'pool' kept changing into 'Pool' :) )

Martinw
10th January 2014, 01:33 PM
re pool my limited knowledge..... I always use a capital in a variable so that when I have finished typing in lower case the first letter changes to a capital which then tells me I am using a proper variable (not just one in my head). I tend to have more frustration than knowledge (the thought of spending hours reading books just for 1 tidbit of information). That is why I have put off this job for so long. The analytical stuff takes most of my time and I can just get it done although I know my code is crap - it is easier just to get a faster processor and more memory.

Ta,
Martin

blackdog1
10th January 2014, 05:24 PM
No worries. Don't count on me though! My knowledge is pretty dated :)

(incidentally, I always wondered why it was convention to use a lowercase letter to begin variable names: e.g. thisIsMyVariable, vs ThisIsMyFunction. Had you followed this convention you would've known something was up when 'pool' kept changing into 'Pool' :) )There is always a good reason for conventions in any sphere of work.

Where I work we have to have a library file of declared variables and where and for what they are used.

Pain initially but saves much time later, also copy and paste of code is almost a sackable offense. Well not quite but you would not want to be caught twice.

Martinw
10th January 2014, 07:32 PM
Agree - conventions and standards are excellent. If the banking industry had stuck to them the crash would not have happened.
But I am a self-taught hobbyist who has never worked as a programmer - I wish I had - so I do not have the benefit of other people's experience. And I appreciate how much a novice like me must frustrate the pro's.
Curious about not copying code - why reinvent the wheel? Assuming it is legal of course.

In the meantime I will keep on hack, hack, hacking on Heaven's door - I am sure that is what Dylan meant to sing.

Ta,
Martin

blackdog1
10th January 2014, 08:11 PM
Curious about not copying code - why reinvent the wheel?lets say you have a pageful of code (a function) that will also do a job in an other part of your app. but you have to change a few variable names it will call on.
It's tempting of course and you ask what could go wrong?

well for starters some of those vars will be global not private, so if you miss changing just one of of them the function will still work because it doesn't 'know' which global vars are you referencing the old ones or the new ones.

there is more to it than that, it need not be a function it could be a directory address or whatever or worse case a pointer address that happens to be valid, but believe me it can drive you nuts trying to find a bug like that because everything seems to work ok but gives you the wrong results.

It probably won't matter as much in a small project.

blackdog1
10th January 2014, 08:20 PM
forgot to add, you might not even know you are getting the wrong results.

Martinw
10th January 2014, 08:52 PM
Thanks for that.

It goes along way in answering an issue I have at times - get the wrong result.
The code runs automatically through the day. As I am not placing bets at this time I just let the computer run through and then go through and tidy up any code at the end of the day and update the records.
Sometimes the code will say to place a bet when it should say no bet and other times the opposite.
I put it down to the excel not being on the screen or something like that.
Now from what you are saying then maybe it is because I have a lot of global variables.
Oh well...more work to do.
Thanks for the heads up.

Ta,
Martin

walkermac
10th January 2014, 11:36 PM
Another convention! All global variables should be named ala: gMyVariable :)

...although globals were thought an indicator of poor design back in my day... Hasn't stopped me lately; I don't even bother defining variables half the time. And memory? How big a deal did that used to be?! And how great is Google?! I don't know VisualBasic, but I know what it *should* be able to do, I google it, and there's a code example! No more manuals. No more learning. We're in a golden age now!!! ;)

If you're looking for another related project to spend time on, you could start collecting xml race files and cobble together an 'automated test harness'. Essentially, have your project cycle through a series of these files (that would ideally represent everything you would encounter in a real-time environment and base decisions on within your program) and verify that the program behaves as it's meant to. That is, instead of making a bet it outputs to a text file noting the action it would've performed. Once all the xml files are processed you compare the text file produced to one that contains the correct results.

A pain to set up, but it quickly and easily highlights logic bugs and allows you to verify you haven't made any unintended changes when you edit.

Oh! Use revision/version control too. It's all coming back to me now. ...make it stop! Make it stop! ;)

aussielongboat
11th January 2014, 10:05 AM
youre right about google and VBA.
i use it all the time for vba code.
Just type up a coding problem and there is someone, somewhere, who has a solution for it.