I am able to detect and get the foreign language code for an arbitrary piece of text in Excel using VBA and either the Google Translate API or the Microsoft Azure Translate API.
Both of those require API keys and accounts with Google or Microsoft, and the client prefers not to do that.
I found another solution where I send the text to Word using VBA automation and then use Word's Selection.DetectLanguage()
feature to determine the language.
This requires that Word be installed with 200+ language packs for every user, and the client prefers not to do that either.
Lastly, I found a hack to programmatically and anonymously call https://translate.google.com/m and translate an arbitrary short amount of text with no API key.
While that site detects and translates the language, it does not tell you what language it is.
Is there a way in VBA other than described above?
Thanks to @hennep in a comment to my question, there is a way to anonymously detect the language of a snippet of text by submitted a GET message to a URL and scraping the resulting HTML that comes back.
How to do this in Excel VBA is shown in the YouTube video "Excel VBA - Google Translate Function in Excel - PART 1 | XLStudio" - https://www.youtube.com/watch?v=UYITBpG7p2Y
The website to use for this is (for example): https://duckduckgo.com/?q=translate+%22wat+is+dit+voor+taal%22+to+english&t=h_&ia=web
Which returns "Dutch detected," which can then be scraped from the HTML.