?
Solved

Put cyrillic chars from VB to Excel

Posted on 2004-04-25
8
Medium Priority
?
1,134 Views
Last Modified: 2008-02-01
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("Sheet1").Activate
 ObjExcel.Range(Header).Activate
 Clipboard.Clear
 Clipboard.SetText (Chr(4) & chr(19))
 ObjExcel.Selection.PasteSpecial
 Clipboard.Clear
 ObjExcel.Workbooks(1).Close 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!
0
Comment
Question by:tofra
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
8 Comments
 
LVL 7

Expert Comment

by:OHDev2004
ID: 10913773
Read this man ,, its a matter that when you copy the cyrillic code the clipboard converts it to the pagecode of the windows, ,, so you need a 3rd parity software as mentioned in the link below ,,

http://www.relcom.ru/English/Russification/WinNetscape/w2ie_eng.html#unipad
0
 
LVL 3

Author Comment

by:tofra
ID: 10913845
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)
0
 
LVL 7

Expert Comment

by:OHDev2004
ID: 10913854
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 ,,,,
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 3

Author Comment

by:tofra
ID: 10914145
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.

0
 
LVL 7

Expert Comment

by:OHDev2004
ID: 10914158
it's because of the Pagecode of the russion or cyrillic  isnt installed on the system :)
0
 
LVL 7

Expert Comment

by:OHDev2004
ID: 10914380
no problem :)
0
 

Accepted Solution

by:
modulo earned 0 total points
ID: 10916079
PAQ-ing the question and refunding 250  points

Thanks  OHDev2004 !

modulo

Community Support Moderator
Experts Exchange
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Suggested Courses

765 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question