Results 1 to 3 of 3

Thread: VBA Coding for English/Spanish Google Translation Error

  1. #1
    Junior Member
    Join Date
    Apr 2015
    Posts
    2
    Rep Power
    0

    VBA Coding for English/Spanish Google Translation Error

    Today something happened and not sure why

    I have this code a simple one that was provided last year and has worked fine to translate cells from English to Spanish

    =IF(B12<>"",getGoogleTranslation(B12,"en","es"),"" )

    obviously if something is in Cell B12 it will translate that work into Spanish in the cell I place that code it ....the code I have in the module is as follows;

    Code:
    Public Function getGoogleTranslation(strSource As String, strSourceLang As String, strDestLang As String) As String 'Created by ShredDude
    '06 September 2010
    
    Dim strURL As String, x As String
    'English = "en"
    'Spanish = "es"
    strURL = "http://translate.google.com/translate_a/t?client=t&text=" & _
            Replace(strSource, " ", "%20") & _
            "&hl=en&sl=" & strSourceLang & _
            "&tl=" & strDestLang & "&multires=1&pc=0&rom=1&sc=1"
                 
    With CreateObject("msxml2.xmlhttp")
        .Open "get", strURL, False
        .send
        x = .responseText
    End With
            
    getGoogleTranslation = Replace(Replace(Split(x, """,""")(0), "[", ""), """", "")
            
    End Function
    The issue I am having now is that today when I opened the program all I see is =value signs, it appears that the code all of a sudden isn't working.....all the workbooks are acting the same

    I tried simply putting a simply sentence in a new workbook and that doesn't work either.....would you have any idea?

    it worked fine since I got the coding but not now .....any help please would be appreciated

    Tony
    Last edited by Admin; 04-09-2015 at 09:33 PM.

  2. #2
    Administrator Excel Fox's Avatar
    Join Date
    Mar 2011
    Posts
    1,402
    Rep Power
    10
    Did you check if there was any change in the firewall settings of your network? Are you in a restricted network, like an office environment for example?
    A dream is not something you see when you are asleep, but something you strive for when you are awake.

    It's usually a bad idea to say that something can't be done.

    The difference between dream and aim, is that one requires soundless sleep to see and the other requires sleepless efforts to achieve

    Join us at Facebook

  3. #3
    Junior Member
    Join Date
    Apr 2015
    Posts
    2
    Rep Power
    0
    yeah nothing had been done to the specific computer, even tried two others and all had the same result, wherever I had that code it simply showed a =value error.....is there a simple code that will let a person type a sentence in a cell and then have it translated in another cell in same sheet??

    Tony

Similar Threads

  1. Replies: 30
    Last Post: 04-15-2019, 07:36 PM
  2. add an addition cell colour to coding
    By peter renton in forum Excel Help
    Replies: 2
    Last Post: 11-20-2014, 05:16 PM
  3. Excel VBA Run-time error '13' Type mismatch
    By mackypogi in forum Excel Help
    Replies: 5
    Last Post: 09-17-2013, 11:16 AM
  4. VBA Trick of the Week :: Tracking the Line Number Where Error Occurs - Erl
    By Transformer in forum Tips, Tricks & Downloads (No Questions)
    Replies: 0
    Last Post: 07-10-2013, 09:40 AM
  5. VBA - Excel: Disable Internet / Google
    By technicalupload in forum Excel Help
    Replies: 3
    Last Post: 10-06-2011, 09:18 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •