MS Excel Vba阿拉伯语unicode [英] MS Excel Vba Arabic unicode

查看:99
本文介绍了MS Excel Vba阿拉伯语unicode的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个文本文件和一个启用了宏的Excel文件.excel文件每行从文本文件中获取(使用vba)字符串(阿拉伯文本),然后将其放在sheet1单元格上.问题是字符串未正确显示.它以随机的日语字符显示.(我的Windows语言环境是Japan).

I have a text file and a macro enabled excel file. the excel file gets (using vba) the string (arabic text) from the text file per line then put it on the sheet1 cells. The problem is the string is not properly displayed. It is displayed in random Japanese characters. (My windows locale is Japan).

这是我的代码:

Open FilePath For Inputs As #1

Do Until EOF(1)

Line Input #1, textline
ActiveWorkbook.sheets(1).Cell(1,1).Value = textline
 'MsgBox(textline)

Loop

Close#1

问题:当粘贴到excel文件中时,如何使字符串(阿拉伯文本)仍然是阿拉伯语?

Question: How can I get the string(arabic text) to be still arabic when pasted in the excel file?

推荐答案

找到了一种使用Excel女士的方法.在数据"选项卡>从文本导入数据"下.不要忘记将编码设置为UTF-8

Found a way around using Ms Excel. Under Data tab > Import Data from text. Dont forget to set the encoding to UTF-8

Voila!魔法!

这篇关于MS Excel Vba阿拉伯语unicode的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆