Jump to content

Trouble with Visual Basic Macro in Excel

- - - - -

  • Please log in to reply
2 replies to this topic

#1
mrcodealot

mrcodealot

    Newbie

  • Members
  • Pip
  • 2 posts
Hello,

I wanted to use visual basic macro in excel to pull search results from Google. I used the following code (that I found from a tutorial) to connect to Google's search engine. I'm not very familiar with how visually basic macro works in excel. The following code actually works; however, I have problem with getting the search engine to output results for the correct region. Since I live in China right now, the macro is generating search results from Google which is not what I want. Is there a way to stop the redirection?

Const GOOGLE_WEBSERVER = "www.google.com"


Function BuildSERPURL(ByVal term As String, ByVal start As Integer) As String

    BuildSERPURL = "http://" & GOOGLE_WEBSERVER & "/search?start=" & start & "&q=" & term

End Function


#2
WingedPanther

WingedPanther

    A spammer's worst nightmare

  • Moderators
  • 16,831 posts
  • Location:Upstate, South Carolina
  • Programming Language:C, C++, PL/SQL, Delphi/Object Pascal, Pascal, Transact-SQL, Others
  • Learning:Java, C#, PHP, JavaScript, Lisp, Fortran, Haskell, Others
Your ISP may be doing the redirection instead of you.
Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog

#3
mrcodealot

mrcodealot

    Newbie

  • Members
  • Pip
  • 2 posts
Thanks. Then I guess it can't be helped since I am on a shared network.




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users