Having viciously yoinked some code from Carlos, I appended it to a userform for a quick google search in word. I'd like to increase the responses to 25. but don't really follow the code. I've tried to obvious things (at least to my eyes)
Having viciously yoinked some code from Carlos, I appended it to a userform for a quick google search in word. I'd like to increase the responses to 25. but don't really follow the code. I've tried to obvious things (at least to my eyes)
Last edited by mdmackillop; 03-31-2005 at 02:46 PM. Reason: Replaced Zip file with amended version.
MVP (Excel 2008-2010)
Post a workbook with sample data and layout if you want a quicker solution.
To help indent your macros try Smart Indent
Please remember to mark threads 'Solved'
Did you try changing this line?
[vba]
For i = 0 To 9
[/vba]
Yep!
There were two 9s, so I changed them both to 25
MVP (Excel 2008-2010)
Post a workbook with sample data and layout if you want a quicker solution.
To help indent your macros try Smart Indent
Please remember to mark threads 'Solved'
It looks like the search page it is pulling up only lists results 1-10, even if your google preferences say 100 per page.
You can make it 25 by making 3 changes
[vba]' Dim Parcial As String, meuArray(9, 1) As String
Dim Parcial As String, meuArray(24, 1) As String[/vba]
[vba]
'ObjXML.Open "GET", "http://www.google.com.br/search?hl=US&q=" &
'strSearch & "&meta=", False
ObjXML.Open "GET", "http://www.google.com.br/search?hl=US&num=100&start=0&q=" _
& strSearch & "&meta=", False
'the 100 here could be 25, may be a little quicker
[/vba]
[vba]' For i = 0 To 9
For i = 0 To 24[/vba]
Should take care of it!
Thanks Matt,
Works a treat. I've posted the corrected file in the original question.
MVP (Excel 2008-2010)
Post a workbook with sample data and layout if you want a quicker solution.
To help indent your macros try Smart Indent
Please remember to mark threads 'Solved'
After looking a bit more into it, that may cause some problems on results 10-25. You may also want to change the instance of "26" to "25 + Len(i)".
I'm gonna take a look a little deeper, see if some more modifications can be made as well. I'll let you know either way
OK,
Just did a bit of work on this one.
First, I changed the variables to something I understood (no offense, Carlos! I just don't speak much Spanish).
I was having a few issues with the FollowHyperlink as well, so I changed the method to follow the link (should work with whatever the default browser is--if you have anything aside from IE where you are give it a try and let me know, I only have IE on my work computer).
Fixed it to display correct amount of results if less than 25 results found
Fixed it if no results found
Fixed it to follow correct links when news results come up on the google search (this one threw me off for a while)
Fixed an apostrophe thing in the response text (was showing up as "& # 3 9 ;" (without the quotes or the spaces between))
Fixed a few other minor issues that I can't specifically think of right now
Was going to change the Title/Link parsing to regexp, but with so few results and its not slow anyways, I decided to leave well enough alone
Give it a whirl, let me know if any issues arise! This was fun
Matt
Hi Matt,
it is Portuguese not Spanish, . No offense taken.
Best Regards,
Carlos Paleo.
To every problem there is a solution, even if I dont know it, so this posting is provided "AS IS" with no warranties.
If Debugging is harder than writing a program and your code is as good as you can possibly make
it, then by definition you're not smart enough to debug it.
http://www.mugrs.org
Ya know....
Ya'll do some pretty amazing stuff around here.
I think it's dang impressive.
~Anne Troy
Hi Matt,
Thanks for the help. Somewhere between posting and getting your response, my PC stopped responding to the FollowHyperlinks command and other similar items, refusing to open web pages and so on. However reformatting the C drive and reinstalling everything seems finally to have done the trick, so I can at last try out your solution.
MVP (Excel 2008-2010)
Post a workbook with sample data and layout if you want a quicker solution.
To help indent your macros try Smart Indent
Please remember to mark threads 'Solved'
Wow, sounds like a very radical way to solve it Malcolm,
Best Regards,
Carlos Paleo.
To every problem there is a solution, even if I dont know it, so this posting is provided "AS IS" with no warranties.
If Debugging is harder than writing a program and your code is as good as you can possibly make
it, then by definition you're not smart enough to debug it.
http://www.mugrs.org
Hi mdmackillop,
Nice piece off work you guys put together!
If you like to Google from Word there's a nice Hack that you can incorporate in the Taskpane to do the search for you. (And show/follow it in the taskpane as well)
Check it out: http://hacks.oreilly.com/pub/h/2725
Enjoy!
_________
Groetjes,
Joost Verdaasdonk
M.O.S. Master
Mark your thread solved, when it has been, by hitting the Thread Tools dropdown at the top of the thread.
(I don't answer questions asked through E-mail or PM's)