Search code examples
excelvbaexcel-2013

Special characters (letters čćžšđ) in Excel 2013 VBA code


I made a program in Excel 2010 VBA that contains letters like ć č š...

Msgbox("Čiča gliša") works.

Looks like Excel 2013 supports those letters in cells and formulas, but not in VBA.

VBA replaces them with some symbols which aren't even on the keyboard.

I get errors executing the code.

I believe it's something to do with language settings.


Solution

  • As BambiLongGone stated, weird string are not likely to work. I would say your best shot is looking at this article. There 's a tool called Unicode to VBA that you can use to convert all your string in your application. For example :

    Čiča gliša
    

    will be converted to

    ChrW$(&H10C) & "i" & ChrW$(&H10D) & "a gli" & ChrW$(&H161) & "a"