Tech or Treat! Write an article about your scariest tech disaster to win gadgets!Learn more

x
?
Solved

Foreign Characters from Excel VBA Web QueryTable Translations

Posted on 2010-08-22
4
Medium Priority
?
1,057 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
[X]
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
  • 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 2000 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

This tutorial explains how to create a series of drop-down lists that are dependent upon prior selections to guide (“force”) the user to make the correct selection and reduce data errors within Microsoft Excel. Excel 2010 was used for this tutorial;…
This article descibes how to create a connection between Excel and SAP and how to move data from Excel to SAP or the other way around.
This Micro Tutorial will demonstrate how to use a scrolling table in Microsoft Excel using the INDEX function.
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

647 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