• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1062
  • Last Modified:

Foreign Characters from Excel VBA Web QueryTable Translations

This references http://www.experts-exchange.com/Software/Office_Productivity/Office_Suites/MS_Office/Excel/Q_26413569.html#deleteNotice
After completing an Excel2007 VBA modified querytable to http://translate.reference.com/  I get results which are good and results that are not seemingly usable.  The good results are those that can be expressed in standard English characters. Any accented characters seem to be returned with some kind of two character codes. Any completely foreign set (Greek, Chinese, Hebrew, Arabic, etc.) comes back as <I am not sure what>.
Please see attached file.
My question is - how to go from the character codes returned to the appropriate foreign equivalent - as in looking like the manually copy/pasted results in Column D.
Regards
Brian     QueryTableTranslate.xls
0
canesbr
Asked:
canesbr
  • 2
1 Solution
 
jjafferrCommented:
Hi

If you can click on the "copy to clipboard", then paste the translation to your excel sheet.

If you use the webbrowser object like this:
Private web As WebBrowser

then I think that button is number 365, and you can click it like this:
web.Document.all(365).click

jaffer
0
 
Robberbaron (robr)Commented:
the query is returning a UniCode character, which is 2 bytes wide.

can you rewrite as an ADo connection, then use CHRW to write out the data ?

many VBA functions dont support unicode by default.
0
 
Robberbaron (robr)Commented:
rewritten to use XML.Get in place of the Excel Webquery.

then parse the returned data to get strings... these are Unicode and transfer correctly.

Sheet1 is now redundant i suspect.

Private Function GetWebPage(ByRef URL As String) As String
    Dim xml 'As IXMLHTTPRequest
    Set xml = CreateObject("Microsoft.XMLHTTP")
    With xml
        .Open "GET", URL, False
        .send
        GetWebPage = .responseText
    End With
    Set xml = Nothing
End Function

Open in new window

Update-QueryTableTranslate.xls
0
 
canesbrAuthor Commented:
Fantasmagorical! That's exactly it!
ThanQ
Regards
Brian
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now