Results 1 to 4 of 4

Google Translate Excel VBA run time 424 issue - getElementByID

Threaded View

  1. #1
    Registered User
    Join Date
    12-01-2018
    Location
    Houston, TX
    MS-Off Ver
    365
    Posts
    2

    Google Translate Excel VBA run time 424 issue - getElementByID

    I used the below Excel VBA function for Google Translate, and it worked perfectly in October 2018. But this week, I tried to use it, and I get the run time error 424 (object required) at the following line:

    CLEAN_DATA = Split(Application.WorksheetFunction.Substitute(IE.Document.getElementById("result_box").innerHTML, "</SPAN>", ""), "<")

    Do you know what has changed in the past month to result in this code not working anymore? I think the ID for Google Translate may have changed, but I do not know how to check and pull the correct ID for the translation results.

    -------------
    Function translate_using_vba(str) As String
    ' Tools Refrence Select Microsoft internet Control
    
    
        Dim IE As Object, i As Long
        Dim j As Integer
        Dim inputstring As String, outputstring As String, text_to_convert As String, result_data As String, CLEAN_DATA
    
        Set IE = CreateObject("InternetExplorer.application")
        '   TO CHOOSE INPUT LANGUAGE
    
        inputstring = "auto"
    
        '   TO CHOOSE OUTPUT LANGUAGE
    
        outputstring = "en"
    
        text_to_convert = str
    
        'open website
    
        IE.Visible = False
        IE.navigate "...I had to remove the link to make the post go through ...
    
        Do Until IE.ReadyState = 4
            DoEvents
        Loop
    
        Application.Wait (Now + TimeValue("0:00:3"))
    
        Do Until IE.ReadyState = 4
            DoEvents
        Loop
    
        CLEAN_DATA = Split(Application.WorksheetFunction.Substitute(IE.Document.getElementById("result_box").innerHTML, "</SPAN>", ""), "<")
    
        For j = LBound(CLEAN_DATA) To UBound(CLEAN_DATA)
            result_data = result_data & Right(CLEAN_DATA(j), Len(CLEAN_DATA(j)) - InStr(CLEAN_DATA(j), ">"))
        Next
    
    
        IE.Quit
        translate_using_vba = result_data
    
    
    End Function
    Last edited by FDibbins; 12-01-2018 at 03:14 AM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Get google translate result from vba?
    By JasperD in forum Excel Programming / VBA / Macros
    Replies: 20
    Last Post: 01-29-2021, 07:36 PM
  2. Macro: translate text from cell using google translate
    By Marc_excel_tips in forum Excel Programming / VBA / Macros
    Replies: 19
    Last Post: 01-05-2021, 06:18 AM
  3. Google Translate VBA Function
    By beardguy in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-06-2018, 06:17 PM
  4. [SOLVED] GetElementById vba issue
    By Sintek in forum Excel Programming / VBA / Macros
    Replies: 43
    Last Post: 02-28-2018, 02:02 PM
  5. Upload excel sheet to google translate (and pull the result) via VBA
    By JasperD in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-08-2017, 04:02 PM
  6. How to catch errors from Google Translate
    By MrsMac in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 05-29-2014, 09:18 AM
  7. need Google Translate in Excel 2003
    By appu_gusai in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-03-2013, 08:27 AM

Tags for this Thread

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1