siper.blogg.se

Translate english french google
Translate english french google






'***This function loops through an array called Data0 loaded with all the values of the worksheet "Translate_Sheet". So after play around with this, my crud code below seems to be doing the job and seem to translate faster.so far! Function Translate_fr_en() I'll keep playing with the timing to optimize the process, unless there's some other workable solutions or recommendations. It seems that 0.8 sec per translated cell.Īt least it's a step in the right direction.

translate english french google

I sometimes get a 'run time error' at MyStrings = ie.document.querySelector (".translation").innerText because it's empty. I just need to figure out timing issues because it's doesn't always put the correct data to the cells when it fetches the translation from Google Translate. I tweaked your code up so that it will open IE and then loop through each cell with just the one IE (Goggle Translate) window open, instead of open/close the window for each cell data translation. However, this method is too slow to translate worksheets, since I need to translate worksheets 60 rows x 36 cols. I did however try your recommendation Excel vba Translate IE.Document emptyĪnd this does return the correct translated response "salle de l'émetteur" now = "transmitter room" with ie.navigate2 "" & "fr" & '/' & "en" & "/" & str".

translate english french google

Maybe the translation issue is with "XMLHTTP" because it seems to return the same translation results when you use try the =Translate(A1,"fr","en") to a cell in Excel. I must be missing something or it's just not clear to me. I tried your recommendation, but get error 91 "Object variable or With block not set". Set objDivs = objHTML.getElementsByTagName("div") tRequestHeader "User-Agent", "Mozilla/4.0 (compatible MSIE 6.0 Windows NT 5.0)" Set objHTTP = CreateObject("MSXML2.ServerXMLHTTP") 'late binding Public Function Translate(strInput As String, strSourceLng As String, strTargetLng As String) As String Instead of objDivs = objHTML.getElementsByTagName("div"), objDiv.className = "t0" Is there a way to get the translation from span class="tlid-translation translation" lang = "en"' I can't figure out how to get this "innertext" from 'span title class' If I inspect the elements in the Google Translate app, I see the correct translation at span class="tlid-translation translation" lang = "en"

translate english french google

If I manually use the Google Translate app I get the correct translation.įrom code of "salle de l'émetteur", returns "director's room".įrom the Google Translate app, correctly returns "transmitter room". With Google Translate, the French to English is not returning the correct values when using the code below.








Translate english french google