Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Foreign Characters from Excel VBA Web QueryTable Translations

Posted on 2010-08-22
4
1,041 Views
Last Modified: 2012-05-10
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
Comment
Question by:canesbr
  • 2
4 Comments
 
LVL 27

Expert Comment

by:jjafferr
ID: 33507078
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
 
LVL 32

Expert Comment

by:Robberbaron (robr)
ID: 33517272
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
 
LVL 32

Accepted Solution

by:
Robberbaron (robr) earned 500 total points
ID: 33517814
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
 

Author Closing Comment

by:canesbr
ID: 33522938
Fantasmagorical! That's exactly it!
ThanQ
Regards
Brian
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction This Article briefly covers methods of calculating the NPV and IRR variants in Excel as well as the limitations in calculating and interpreting IRR results. Paraphrasing Richard Shockley, author of my favourite finance reference tex…
Convert between Excel file formats (.XLS, .XLSX, .XLSM) with/without macro option David Miller (dlmille) Intro Over this past Fall, I've had the opportunity to see several similar requests and have developed a couple related solutions associate…
This Micro Tutorial will demonstrate on a Mac how to change the sort order for chart legend values and decrpyt the intimidating chart menu.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question