Modify existing code to identify language

NiallJG91

New Member
Joined
Jun 8, 2020
Messages
2
Office Version
  1. 2016
Platform
  1. Windows
Hi All,
I recently found code on this site, linked below, which translates the contents of a cell using Google Translate.
This is great functionality, and I am wondering is it possible to modify the code so that the auto detected language is returned as the result instead of the translation?

Google Translate Macro Function - How to rafear to Cell and/or Text in Quotes?

Any advice would be gravely appreciated!
 

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 don't think that code can be modified to identify the input language.

Probably the easiest and most reliable method is with the Google Translation API - specifically the detect 'method':
You need a Google Account and project, as explained on that page, and you could use the free trial.

There should be some posts on this forum showing how to call a Google API using VBA and the code for the Translation API should be similar.
 
Upvote 0
Maybe, encorporate a webscrape on the Google translate site of the Language found after the String is transmitted to the Google translator?
 
Upvote 0

Forum statistics

Threads
1,214,920
Messages
6,122,267
Members
449,075
Latest member
staticfluids

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