title: Using Google Translate in a Excel VBA macro
body: <p>Folks....For some years now I have used the following function in one of my Excel macros to help me compose photo captions from English into French.  This AM it started throwing an error, which pointed to the <code>.Send</code> command in the code below:</p>
  
  <pre><code>Public Function getGoogleTranslation(strSource As String, strSourceLang As String, strDestLang As String) As String
  Dim strURL As String, x As String
  
  strURL = "http://translate.google.com/translate_a/t?client=t&amp;text=" &amp; _
           Replace(strSource, " ", "%20") &amp; _
           "&amp;hl=en&amp;sl=" &amp; strSourceLang &amp; _
           "&amp;tl=" &amp; strDestLang &amp; "&amp;multires=1&amp;pc=0&amp;rom=1&amp;sc=1"
  
  With CreateObject("msxml2.xmlhttp")
      .Open "get", strURL, False
      .send
      x = .responseText
  End With
  
  getGoogleTranslation = Replace(Replace(Split(x, ",")(0), "[", ""), """", "")
  
  End Function
  </code></pre>
  
  <p>When I copy/paste the contents of strURL directly into IE, the first time I got a CAPTCHA and a comment that they are checking for 'robots'. The second time it worked directly.  They must be setting a cookie??  </p>
  
  <p>Is there anyway around this? Or another way to get simple phrases translated in a macro?</p>
  
  <p>Thanks....RDK</p>