VBA code outputs Arabic characters wrong

New Contributor

Hello,

I've been having a problem with writing and displaying Arabic characters in excel and VBA.

In excel I found a solution that I have to change the pc region and language to Arabic and it worked.

In VBA I found a solution to show the characters when I write them in the code and this also worked. But when I output this value it shows as weird characters or as question marks.

 

1.PNG

 

Here's the VBA solution to show the characters when I write them in the code. And you can see that it worked since there's a string written in Arabic.

 

Now for the execution of the above code:

 

2.PNG 

The first line outputs the value of the cell written in Arabic and the output is correct.

 3.PNG

The second line displays the Arabic string written in the code and as you can see it displays something different.

 

Can anyone help me with this problem?

0 Replies