How to insert Japanese character to ECC from Excel vba - excel

I can see the Japanese text in the Excel cells. I've got the VBA code to update ECC. It does the INSERT in the ECC, but Japanese characters are simply represented as ????.
Any help would be appreciated.

Sorry, feels like it's been quite a time since the question was raised.
But still I'd like to propose a solution:
Using unicode encoding to represent different language:
Sheet1.Cells(2, 1) = ChrW(&H3091),
which is standing for character ゑ.

You need MS Excel Japanese Language Pack to display Japanese characters.
If you are importing text into Excel, you need to set the following.
.TextFilePlatform = 850
http://www.ozgrid.com/forum/showthread.php?t=141269

Related

An issue when generating text with national symbols using VBA in Excel 2019

I am using some VBA add-in to generate text from numbers, that text contains national Lithuanian, German or any other national symbols. This used to work fine with the previous versions of Excel so far, but the system has now been upgraded from scratch and it does not seem to work well with Excel 2019.
In VBA, the code looks fine and you can see the national symbols like "š" (well after setting the locale to Lithuanian, before they were appearing as multiple strange symbols):
, however when in excel the functional is called, the output has just � instead of any national symbol. All of the national symbols are marked with the same � sign in Excel 2019. But you can write manually national symbols just fine in Excel, just what comes out of VBA is garbage missing those symbols.
It looks like this in a cell:
Trys �imtai �, 00 ct
Does anybody know how to fix this and make them appear normal with how they are visible within the code?
A few other observations are that when copying and pasting the code from the VBA Editor to Notepad++ the national symbols get lost as well and they appear as different strange symbols. Also when trying to use the find function in the VBA Editor window to find anything with the national symbols - no results are ever found as long as you don't remove the national symbols...
In my understanding, support for "international" ("non-Latin") characters is determined by your Windows Regional Settings, not by Excel or by the VBA IDE.
Since I'm in Canada I can't easily test on my end to verify this, but interestingly, your example character of š displays the opposite of how it shows for you: it renders properly on the worksheet but as gibberish in VBA.
Incidentally I determined the Unicode id number for š (Unicode 353) by pasting the symbol into cell A1 and then in another cell using formula =UNICODE(A1). The opposite function (to return a character from it's code) is UNICHAR. The VBA equivalents are AscW and ChrW.
I was aware that the VBA IDE can be made to display "international" characters by adjusting Windows Regional Settings (like discussed here), but I didn't realize any setup would make them not render on the spreadsheet since for me, most Unicode characters display properly on a worksheet.
I assume the characters don't work for you in other applications besides Excel. If that's not the case, and this problem is specific to Excel (or if you can't otherwise get it figured out by adjusting Windows Regional Settings), then I'd suggest contacting Microsoft Tech Support.
More information is here or here or in this search might also be helpful.
hi i had same problem in latvian
just uncheck utf - 8 beta in regional language settings for non unicode
enter image description here

Does Excel for Mac 2016 properly import Unicode in .csv files?

A semi-well-known bug in Excel for Mac 2011 causes it to mangle imported .csv files containing accented Unicode characters. See: Microsoft Excel mangles Diacritics in .csv files?
For example, Pérez might get imported as Pérez.
My question: has this been fixed in Excel for Mac 2016?
No this has not been fixed in Excel for Mac 2016 and still miss-imports "Pérez". You can fix it in Excel by opening a New Worksheet, then "Import" and specifying UTF8 as the encoding. However there does not seem to be a way to construct a CSV that can be imported without knowing beforehand that it is going to Excel.
This is a workaround for my own particular UTF-8 problem, refers to tab-separated values rather than CSV, and also involves proprietary software*. Hence it may not be of general applicability. However I am posting it in case anyone else finds it useful or is able to adapt it to their problem.
I work with a UTF-8 MySQL database which contains one field with UTF-8 text because of Greek symbols. After making an SQL query I often paste from my Mac terminal into the BBEdit text editor, do some minor clean up, and then import into Excel for distribution and presentation. Having read the answer from #MitraArdon, the following allows me to preserve the UTF-8:
Set the BBEdit text document as Unicode (UTF-8, with BOM)† using the selection options at the bottom of the page.
Launch Excel 2016 and import the text file (as delimited text — I use the pipes from the MySQL tables as delimiters). Save as .xlsx.
There is no step 3 (as the ad used to say).
For the reverse process I cannot do the normal “Save as tab delimited text” as the Greek letters will be replaced by underscores. As the document is in UTF-16 one must:
Select “Save as UTF-16 Unicode Text (.txt)”
Open in BBEdit and change the format to UTF-8 (generally ‘No BOM’).
Then I can upload back into my UTF-8 MySQL database, if required.
Footnotes
*Actually BareBones’ cutdown free text editor, TextWrangler, should also work as it has the option to save as UTF-8 BOM.
†Or convert to UTF-16 BOM.

Remove Unicode UTF-8 character from string in VBA

I'm using excel vba to take a dataset and build an XML file.
The data comes in with some unicode characters inside some of the comments fields.
This causes problems for the XML.
Would like to strip out any of these non-printable characters during the vba process.
Thanks
WorksheetFunction.Clean() should help: http://msdn.microsoft.com/en-us/library/microsoft.office.interop.excel.worksheetfunction.clean%28v=office.14%29.aspx

Opening VBA code exchanges characters

I have a problem with some code I have written in an English version of Excel 2011 for mac. When I open the workbook in Excel 2013 in Swedish certain Swedish letters in the code get converted to other characters, rendering the code useless. In other words, I have used special characters to define variables (I know, not good practice) and as conditionals (If x = 'Ombeställning' for example).
Is there an easy way to force the compiler to read my code as UTF-8? I'm on a tight deadline and I really don't feel like retracting all my variable declarations and subsequently changing my defined range names. If there is no other way, please tell me so I can get on changing the code.
Lastly, opening the workbook in Excel 2013 changed some of the row widths/heights, is this avoidable? I've spent a lot of time on formatting and it simply doesn't look professional when parts of the text are cut off etc.
EDIT: I forgot to mention I am opening 'Excel 2013 ' on a PC, which is probably the culprit regarding character encoding rather than the Excel version language.

Unicode characters in VBA Macros in Excel?

I have list of students and i want to invert the "Name Surname" format to "Surname Name".
My problem isn't the coding, but it's the UTF-8 support for my language.
I tested the macro with looping through the names and displaying them in a msgBox, but i get question marks for every name.
Anyone else had problems with UTF-8 in Excel Macros?
UTF-8 and Unicode mean different things, so it's hard to understand what you're asking for.
In principle, VBA uses 2-byte unicode (UCS-2) internally. This is not the same as UTF-8 which many external programs expect.
The StrConv() built-in function can convert back and forth.

Resources