tofra
asked on
Put cyrillic chars from VB to Excel
How can i put cyrillic characters to Excel using VB? I have the unicode for the chars i need to use. For example, \u0419 (ƣ)
Now i'm using the following code:
But this shows an ? in excel. (also in clipboard)
Set ObjExcel = New Excel.Application
ObjExcel.Workbooks.Open ("c:\tom.xls")
ObjExcel.Worksheets("Sheet 1").Activa te
ObjExcel.Range(Header).Act ivate
Clipboard.Clear
Clipboard.SetText (Chr(4) & chr(19))
ObjExcel.Selection.PasteSp ecial
Clipboard.Clear
ObjExcel.Workbooks(1).Clos e SaveChanges:=True
Set ObjExcel = Nothing
Trying to write to a text file was succesful!
Open "c:\tomresult.txt" For Output As #1
Print #1, Chr(255) & Chr(254) & Chr(19) & Chr(4)
Close #1
Please HELP!
Now i'm using the following code:
But this shows an ? in excel. (also in clipboard)
Set ObjExcel = New Excel.Application
ObjExcel.Workbooks.Open ("c:\tom.xls")
ObjExcel.Worksheets("Sheet
ObjExcel.Range(Header).Act
Clipboard.Clear
Clipboard.SetText (Chr(4) & chr(19))
ObjExcel.Selection.PasteSp
Clipboard.Clear
ObjExcel.Workbooks(1).Clos
Set ObjExcel = Nothing
Trying to write to a text file was succesful!
Open "c:\tomresult.txt" For Output As #1
Print #1, Chr(255) & Chr(254) & Chr(19) & Chr(4)
Close #1
Please HELP!
ASKER
The complete progress is, greb data from mysql database, put it into the excel file. Because everything is automated, i can't use this manual action. The purpose i'm using it for is to create an invoice with cyrillic chars. (customs demand it)
i know but when you paste the text to the clipboard it's converted to nonunicode
then you try to paste it ,,
look there is another way for doing this :
the string abcd is actually U+0061 U+0062 U+0063 U+0064
so i think you must make a routine to get the character or its unicode then return the code as above then copy it to clipboard ,, and paste it as you've done ,,,,
then you try to paste it ,,
look there is another way for doing this :
the string abcd is actually U+0061 U+0062 U+0063 U+0064
so i think you must make a routine to get the character or its unicode then return the code as above then copy it to clipboard ,, and paste it as you've done ,,,,
ASKER
I found it!
Instead of using the clipboard for pasting my text to excel, i can do it directly!
ObjExcel.Range("A1").Value = ChrB(19) & ChrB(4)
Now i saw the cyrillic character.
Still, i find it strange that the clipboard can't work together with vb and handle unicode. Copy past with notepad works well.
Instead of using the clipboard for pasting my text to excel, i can do it directly!
ObjExcel.Range("A1").Value
Now i saw the cyrillic character.
Still, i find it strange that the clipboard can't work together with vb and handle unicode. Copy past with notepad works well.
it's because of the Pagecode of the russion or cyrillic isnt installed on the system :)
no problem :)
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
http://www.relcom.ru/English/Russification/WinNetscape/w2ie_eng.html#unipad