Solved

Foreign Characters from Excel VBA Web QueryTable Translations

Posted on 2010-08-22
4
1,034 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

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…
Improved? Move/Copy Add-in Replacement - How to avoid the annoying, “A formula or sheet you want to move or copy contains the name XXX, which already exists on the destination worksheet.” David Miller (dlmille)  It was one of those days… I wa…
The view will learn how to download and install SIMTOOLS and FORMLIST into Excel, how to use SIMTOOLS to generate a Monte Carlo simulation of 30 sales calls, and how to calculate the conditional probability based on the results of the Monte Carlo …
The viewer will learn how to use the =DISCRINV command to create a discrete random variable, use this command to model a set of probabilities and outcomes in a Monte Carlo simulation, and learn how to find the standard deviation of a set of probabil…

919 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now