Hi, I have VBA code that's been working fine for years - it pulls odds from oddschecker using a web query. An example url would be http://www.oddschecker.com/horse-racing-betting/brighton/16%3A45 (Obviously %3A in place of : colon).
If I take the above url and paste it into a browser, it loads just fine.
If I run a manual web query and paste above url, it loads and pastes just fine.
If I call it through VBA I get the dreaded 1004 error.
To try and fix it I have tried: 1. Manual and inetcpl.cpl reset of IE 2. Login/no login into oddschecker before running web query 3. Recording macro during which time I do manual web query - then dumping that code into new .xlsm. Returns 1004 error. Not a priv problem, other urls run just fine.
In order that I don't lose my last shred of sanity please don't suggest that I check the forums or post for help. Amazingly that thought has already occurred to me (yep, get quite sarcastic when frustrated).
Could it be a f*cking flash ad/totally unnecessary whizzy add-in show off piece of crap... more than likely. Yes, I know I could stick an IE control on a UF and parse the source with DOM, but this is straightforward code and it's been working for years, so why not today!
I can't see any obvious changes to their site, I've made no updates. http://www.oddschecker.com loads and pastes just fine.
It was working this morning, then I had a few sporadic errors... now it's just ground to a halt. I know it's easy to blame the colon (and would it have killed you to use an underscore oddschecker.. would it!) but they made that change a while ago and it didn't cause any problems.
The fact it's only just started playing up (I've rebooted, unzipped for clean files etc) makes me think it's a flash ad... I LOATHE them with a passion. Half the time they don't trigger readystatecomplete events... they waste bandwith and processing power. No purpose whatsoever.
[and time to breathe ....]
Parsing the source it is then, at least I'll have navigate2 figure out when the page does finish loading instead of going around and around in flash-ad-land.
Thanks for replying. not having a day as you might have guessed
I can't see any obvious changes to their site, I've made no updates. http://www.oddschecker.com loads and pastes just fine.It was working this morning, then I had a few sporadic errors... now it's just ground to a halt. I know it's easy to blame th
Sounds from your intermittent symptoms like you're on the right track. I've never had to deal with flash ads and don't use VBA for this kind of stuff so sorry couldn't be more help.
no worries.Sounds from your intermittent symptoms like you're on the right track. I've never had to deal with flash ads and don't use VBA for this kind of stuff so sorry couldn't be more help.
The 1004 error is most likely because the data copied from the site is now filtered.
It is a paste error and usually only occurs when copied data is filtered and you then try to paste it.
I haven't the time to look it all up but there are some workarounds like pasting rows separately.
Try googling for an answer.
Hi yeahyeahwhatever,The 1004 error is most likely because the data copied from the site is now filtered.It is a paste error and usually only occurs when copied data is filtered and you then try to paste it.I haven't the time to look it all up but the
I just checked out the site and it is coming up with a script error but is still loading onto my excel 2007
When you do a web query it copies the data with the yellow arrows and pastes it into excel, it works differently when putting the data in a browser.
If the data in the web query is filtered and it copies that data, then tries to paste it in excel that is when the 1004 occurs.
If the data is not filtered and still comes up with 1004 it could be the script error causing the problem. As you are calling via a VBA module, I cannot trace the error as I don't have the module.
It is late here in Oz and I'm of to bed. Will check in tomorrow to see how you fared.
I just checked out the site and it is coming up with a script error but is still loading onto my excel 2007When you do a web query it copies the data with the yellow arrows and pastes it into excel, it works differently when putting the data in a bro
Got in bed and the idea came to me that you probably don't have an error trap routine in your VBA.
When you do it manually it comes up with a script error and "Do you want to continue anyway" I clicked yes and it loaded. If a VBA module struck that without a error trapping routine it could not continue so threw up the 1004.
Hope that helps. The next time you try it may work fine as the script error may be fixed.
I suggest you put in your calling module an error trapping sub routine.
Cheers.
Got in bed and the idea came to me that you probably don't have an error trap routine in your VBA.When you do it manually it comes up with a script error and "Do you want to continue anyway" I clicked yes and it loaded. If a VBA module struck that wi
CM, you're going down the wrong path with this "filtered data" approach. The data pulled from the data isn't filtered. I know many 1004 help pages on the net refer to filtered data but that's because they're talking about worksheet to worksheet copying. I appreciate it's the same error#, but knowing a potential solution for filtered data from ws to ws isn't transferable here.
I don't get any script errors - and I've tried FF/Chrome/Opera/IE7&8. If you want the module code, just record a macro, and run a webquery.
thanks anyway.
CM, you're going down the wrong path with this "filtered data" approach. The data pulled from the data isn't filtered. I know many 1004 help pages on the net refer to filtered data but that's because they're talking about worksheet to worksheet cop
After a lot more reading it seems as though Office triggers a 1004 error when it can't complete a paste - often down to insufficient pagefiles/clipboard. Now there are times when I think oddschecker's main aim in life is to stick as many controls on its site as possible, and if I was on a machine with minimum page files and low RAM I could, possibly, accept that I ran into memory problems... but this afternoon I took over most of the machines in the office and even when I was on a souped-up i7, 64bit Windows with 32gb memory I was still having problems. I can't believe I filled the (very generous) page files/clipboard on that.
What I think has happened is that because there was a "special offer" control on the pages I wanted, I think that was, possibly, returning a false positive for EOF, endOfControl, whatever and causing the paste to fail. After all, I could load and paste www.oddschecker.com without problem, it was only when I went to individual race pages that I saw an error.
oh well, the upshot of this is that it made me drag that ancient webquery sub into the 21st century and now it's a new, clean parse of the source using the DOM.
I'm off to bed. Thanks for your replies.
After a lot more reading it seems as though Office triggers a 1004 error when it can't complete a paste - often down to insufficient pagefiles/clipboard. Now there are times when I think oddschecker's main aim in life is to stick as many controls on