translate from English to other language without google translator assisstance in excel

dss28

Board Regular
Joined
Sep 3, 2020
Messages
165
Office Version
  1. 2007
Platform
  1. Windows
I want to translate the english text to other language without going online using internet to ggogle or other translating sites.

I want to use the excel inbuilt "translate menu" as the user do not have access to internet.

If the user enters english text in a textbox in a userform, it should automatically translate to the desired language in another textbox in the same userform.
I tried recording macro using the excel function "Review -- Translate" but could not succeed.
will be highly obliged for any help....
 

Excel Facts

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest
I tried recording macro using the excel function "Review -- Translate"
Without trying to record a macro, if you do that manually without an internet connection does it translate for you?
 
Upvote 0
Without trying to record a macro, if you do that manually without an internet connection does it translate for you?
no sir,
that means the inbuilt function also takes help from online sites only?
 
Upvote 0
Exactly. So I think that you are most likely out of luck. :(

ok.

is there any code that will help me perform the same task automatically by connecting to google translator as soon as I finish entering my text in english in one textbox (maybe textbox change event) and translated text appears in the other textbox.
 
Upvote 0
Sorry, this area is not a strength of mine. Perhaps somebody else might step in to offer you something. I suspect that your office version (2007) might be a hindrance to some more recent options.
 
Upvote 0
If the user enters english text in a textbox in a userform, it should automatically translate to the desired language in another textbox in the same userform.

Call this GoogleTranslate function from one of the textbox event handlers:

 
Upvote 0
Call this GoogleTranslate function from one of the textbox event handlers:

Sir, Need step by step help to use it : (will not be able to build myself)
I have a UserForm5 with two textboxes - TextBox140 to input text in English which should get converted to language "Marathi" and show result in TextBox8
I have placed all the above code in a module.
however unable to code the translation part so that the trasnlation appears in textbox8.

Code does not include translation to Marathi language?
 
Upvote 0
I have placed all the above code in a module.
OK.

You could put this code in the same module and run it to show UserForm5:
VBA Code:
Public Sub Show_Form5()
    Dim form As UserForm5
    Set form = New UserForm5
    form.Show
End Sub

I have a UserForm5 with two textboxes - TextBox140 to input text in English which should get converted to language "Marathi" and show result in TextBox8

Put this in the UserForm5 module:
VBA Code:
Private Sub TextBox140_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer)
    If KeyCode = Asc(vbCr) And TextBox140.Value <> "" Then
        TextBox8.Value = GoogleTranslate(TextBox140.Value, "en", "mr")
    End If
End Sub
When you type English text in TextBox140 and press the Enter key, the text is translated to Marathi and put in TextBox8.

Code does not include translation to Marathi language?
The translation from and to languages are specified as the 2nd and 3rd arguments of the GoogleTranslate VBA function. The available language codes are shown at Language support | Cloud Translation | Google Cloud. Marathi is mr.
 
Last edited:
Upvote 0
OK.

You could put this code in the same module and run it to show UserForm5:
VBA Code:
Public Sub Show_Form5()
    Dim form As UserForm5
    Set form = New UserForm5
    form.Show
End Sub



Put this in the UserForm5 module:
VBA Code:
Private Sub TextBox140_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer)
    If KeyCode = Asc(vbCr) And TextBox140.Value <> "" Then
        TextBox8.Value = GoogleTranslate(TextBox140.Value, "en", "mr")
    End If
End Sub
When you type English text in TextBox140 and press the Enter key, the text is translated to Marathi and put in TextBox8.


The translation from and to languages are specified as the 2nd and 3rd arguments of the GoogleTranslate VBA function. The available language codes are shown at Language support | Cloud Translation | Google Cloud. Marathi is mr

thanks sir for your precious time.

first I got error "Run time error 438, Object doesnot support this property or method" on line

' URL = "Google Translate" & fromLanguage & "&sl=" & fromLanguage & "&tl=" & toLanguage & "&ie=UTF-8&prev=_m&q=" & WorksheetFunction.EncodeURL(text)

which I tried replacing with
URL = "Google Translate"

then got error "Run time error 13, Type mismatch" on line
GoogleTranslate = CVErr(xlErrValue)
 
Upvote 0

Forum statistics

Threads
1,224,828
Messages
6,181,209
Members
453,023
Latest member
alabaz

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top