Hello all,
time ago I used
this[
^] Excel macro to translate texts in an Excel document automatically.
It worked like charm, but now I can't get it to work... all the magic happens here:
Dim strUrl As String
Dim strResult As String
On Error GoTo ErrHandler:
strText = Replace$(strText, Chr$(32), "%20")
strText = Replace$(strText, Chr$(160), "%20")
strUrl = "http://translate.google.com/translate_a/t?client=t&text={S}&hl=en&sl={F}&tl={T}&multires=1&pc=0&rom=1&sc=1"
strUrl = Replace$(strUrl, "{S}", strText)
strUrl = Replace$(strUrl, "{F}", Split(strSHORTCODES, ",")(eFrom))
strUrl = Replace$(strUrl, "{T}", Split(strSHORTCODES, ",")(eTo))
Dim oHttp As Object
Set oHttp = CreateObject("MSXML2.XMLHTTP")
oHttp.Open "GET", strUrl, False
oHttp.Send
If oHttp.Status = 200 Then
strResult = Replace$(Mid$(CStr(Split(strResult, ",")(0)), 4), Chr$(34), "")
Else
strResult = "FAILED!"
End If
Set oHttp = Nothing
Translate = strResult
ErrHandler:
MsgBox(Err.Description)
I can't get it to work now... the macro is executed and I can see how the code reaches the SEND call but it simply disappears here...
I've added a Error handler and I can see that the message that appears is "DENIED ACCESS".
Any idea on why it is happening?
Even I don't think this has something to do... The last time I executed this macro I was using windows 8.1 and now I'm using windows 7.
I can imagine the error coming from a new Google policy, from my new installation...
Any hint?
Thank you all!