简体   繁体   中英

Displaying Japanese text in the Immediate Window of Excel VBA

In Excel 2010, I have a worksheet containing Japanese text. There is no problem editing, or displaying this. When I grab the value of a cell containing Japanese and use Debug.Print to display it in the Immediate Window it appears as ???? This would be a familiar issue if I was dealing with a browser. I would just make sure everything was in UTF-8 encoding. I have Japanese installed on my English Windows and that's all working fine. In Excel I tried to set the default language to Japanese. I changed the editor font to Arial Unicode but so far I still get question marks. I contacted Microsoft. I was passed from one person to another, but they couldn't help. They offered to pass me to a Technical support person who would charge me 500 US dollars!

How can I debug Japanese values in an English version of Excel using the Immediate Window?

The VBA development environment depends on the Windows "system locale" setting to tell it what character set to use. I got it to work using

  • Windows Vista (English)
  • Excel 2010 (English)

by going into the "Regional and Language Options" section of the Windows Control Panel and setting the system locale to "Japanese (Japan)"

jpLocale.png

After my system rebooted I could see Japanese characters in the VBA Immediate Window:

jpVBA.png

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM