First of all i need to explain why I need this because its the usual question that people ask me. I use some excel file for Autocad automation. Im basicaly fillin the tables in Autocad from the data in Excel. I export the CSV in a separate file from that same excel (Im using a macro for that) and use that in Autocad. It all works fine when using English keyboard. Coleagues from Moscow asked me if i could do the same automation For CAD in their office. Of course they all use russian letters in their work. Problem occurs when i save the csv from the excel i use in Russian instead of letters i get a lot of question marks. I didnt even bother to import that in Autocad. But the thing that works is hex representation of the given letter.
For example,<table border="0" cellpadding="0" cellspacing="0" height="661" width="123"><tbody> <tr style="height:15.0pt" height="20"> <td style="height:15.0pt" height="20">ц</td> <td>\U+0446</td> </tr> <tr style="height:15.0pt" height="20"> <td style="height:15.0pt" height="20">у</td> <td>\U+0443</td> </tr> <tr style="height:15.0pt" height="20"> <td style="height:15.0pt" height="20">к</td> <td>\U+043A</td> </tr> <tr style="height:15.0pt" height="20"> <td style="height:15.0pt" height="20">е</td> <td>\U+0435</td> </tr> <tr style="height:15.0pt" height="20"> <td style="height:15.0pt" height="20">н</td> <td>\U+043D</td> </tr> <tr style="height:15.0pt" height="20"> <td style="height:15.0pt" height="20">г</td> <td>\U+0433</td> </tr> <tr style="height:15.0pt" height="20"> <td style="height:15.0pt" height="20">ш</td> <td>\U+0448</td> </tr> <tr style="height:15.0pt" height="20"> <td style="height:15.0pt" height="20">щ</td> <td>\U+0449</td> </tr> <tr style="height:15.0pt" height="20"> <td style="height:15.0pt" height="20">з</td> <td>\U+0437</td> </tr> <tr style="height:15.0pt" height="20"> <td style="height:15.0pt" height="20">х</td> <td>\U+0445</td> </tr> <tr style="height:15.0pt" height="20"> <td style="height:15.0pt" height="20">ъ</td> <td>\U+044A</td> </tr> <tr style="height:15.0pt" height="20"> <td style="height:15.0pt" height="20">ф</td> <td>\U+0444</td> </tr> <tr style="height:15.0pt" height="20"> <td style="height:15.0pt" height="20">ы</td> <td>\U+044B</td> </tr> <tr style="height:15.0pt" height="20"> <td style="height:15.0pt" height="20">в</td> <td>\U+0432</td> </tr> <tr style="height:15.0pt" height="20"> <td style="height:15.0pt" height="20">а</td> <td>\U+0430</td> </tr> <tr style="height:15.0pt" height="20"> <td style="height:15.0pt" height="20">п</td> <td>\U+043F</td> </tr> <tr style="height:15.0pt" height="20"> <td style="height:15.0pt" height="20">р</td> <td>\U+0440</td> </tr> <tr style="height:15.0pt" height="20"> <td style="height:15.0pt" height="20">о</td> <td>\U+043E</td> </tr> <tr style="height:15.0pt" height="20"> <td style="height:15.0pt" height="20">л</td> <td>\U+043B</td> </tr> <tr style="height:15.0pt" height="20"> <td style="height:15.0pt" height="20">д</td> <td>\U+0434</td> </tr> <tr style="height:15.0pt" height="20"> <td style="height:15.0pt" height="20">ж</td> <td>\U+0436</td> </tr> <tr style="height:15.0pt" height="20"> <td style="height:15.0pt" height="20">э</td> <td>\U+044D</td> </tr> <tr style="height:15.0pt" height="20"> <td style="height:15.0pt" height="20">я</td> <td>\U+044F</td> </tr> <tr style="height:15.0pt" height="20"> <td style="height:15.0pt" height="20">ч</td> <td>\U+0447</td> </tr> <tr style="height:15.0pt" height="20"> <td style="height:15.0pt" height="20">с</td> <td>\U+0441</td> </tr> <tr style="height:15.0pt" height="20"> <td style="height:15.0pt" height="20">м</td> <td>\U+043C</td> </tr> <tr style="height:15.0pt" height="20"> <td style="height:15.0pt" height="20">и</td> <td>\U+0438</td> </tr> <tr style="height:15.0pt" height="20"> <td style="height:15.0pt" height="20">т</td> <td>\U+0442</td> </tr> <tr style="height:15.0pt" height="20"> <td style="height:15.0pt" height="20">ь</td> <td>\U+044C</td> </tr> <tr style="height:15.0pt" height="20"> <td style="height:15.0pt" height="20">б</td> <td>\U+0431</td> </tr> <tr style="height:15.0pt" height="20"> <td style="height:15.0pt" height="20">ю</td> <td>\U+044E</td> </tr> </tbody></table>When imported in CAD this works just fine. Russian letters appear.
So my question is, is there a way to translate the Russian letters in above stated manner, in the moment when macro saves the csv. To be perfectly clear, i want my excel unchanged, but the csv translated.
This is the code i use for csv save as:
Thanks in advance!
For example,<table border="0" cellpadding="0" cellspacing="0" height="661" width="123"><tbody> <tr style="height:15.0pt" height="20"> <td style="height:15.0pt" height="20">ц</td> <td>\U+0446</td> </tr> <tr style="height:15.0pt" height="20"> <td style="height:15.0pt" height="20">у</td> <td>\U+0443</td> </tr> <tr style="height:15.0pt" height="20"> <td style="height:15.0pt" height="20">к</td> <td>\U+043A</td> </tr> <tr style="height:15.0pt" height="20"> <td style="height:15.0pt" height="20">е</td> <td>\U+0435</td> </tr> <tr style="height:15.0pt" height="20"> <td style="height:15.0pt" height="20">н</td> <td>\U+043D</td> </tr> <tr style="height:15.0pt" height="20"> <td style="height:15.0pt" height="20">г</td> <td>\U+0433</td> </tr> <tr style="height:15.0pt" height="20"> <td style="height:15.0pt" height="20">ш</td> <td>\U+0448</td> </tr> <tr style="height:15.0pt" height="20"> <td style="height:15.0pt" height="20">щ</td> <td>\U+0449</td> </tr> <tr style="height:15.0pt" height="20"> <td style="height:15.0pt" height="20">з</td> <td>\U+0437</td> </tr> <tr style="height:15.0pt" height="20"> <td style="height:15.0pt" height="20">х</td> <td>\U+0445</td> </tr> <tr style="height:15.0pt" height="20"> <td style="height:15.0pt" height="20">ъ</td> <td>\U+044A</td> </tr> <tr style="height:15.0pt" height="20"> <td style="height:15.0pt" height="20">ф</td> <td>\U+0444</td> </tr> <tr style="height:15.0pt" height="20"> <td style="height:15.0pt" height="20">ы</td> <td>\U+044B</td> </tr> <tr style="height:15.0pt" height="20"> <td style="height:15.0pt" height="20">в</td> <td>\U+0432</td> </tr> <tr style="height:15.0pt" height="20"> <td style="height:15.0pt" height="20">а</td> <td>\U+0430</td> </tr> <tr style="height:15.0pt" height="20"> <td style="height:15.0pt" height="20">п</td> <td>\U+043F</td> </tr> <tr style="height:15.0pt" height="20"> <td style="height:15.0pt" height="20">р</td> <td>\U+0440</td> </tr> <tr style="height:15.0pt" height="20"> <td style="height:15.0pt" height="20">о</td> <td>\U+043E</td> </tr> <tr style="height:15.0pt" height="20"> <td style="height:15.0pt" height="20">л</td> <td>\U+043B</td> </tr> <tr style="height:15.0pt" height="20"> <td style="height:15.0pt" height="20">д</td> <td>\U+0434</td> </tr> <tr style="height:15.0pt" height="20"> <td style="height:15.0pt" height="20">ж</td> <td>\U+0436</td> </tr> <tr style="height:15.0pt" height="20"> <td style="height:15.0pt" height="20">э</td> <td>\U+044D</td> </tr> <tr style="height:15.0pt" height="20"> <td style="height:15.0pt" height="20">я</td> <td>\U+044F</td> </tr> <tr style="height:15.0pt" height="20"> <td style="height:15.0pt" height="20">ч</td> <td>\U+0447</td> </tr> <tr style="height:15.0pt" height="20"> <td style="height:15.0pt" height="20">с</td> <td>\U+0441</td> </tr> <tr style="height:15.0pt" height="20"> <td style="height:15.0pt" height="20">м</td> <td>\U+043C</td> </tr> <tr style="height:15.0pt" height="20"> <td style="height:15.0pt" height="20">и</td> <td>\U+0438</td> </tr> <tr style="height:15.0pt" height="20"> <td style="height:15.0pt" height="20">т</td> <td>\U+0442</td> </tr> <tr style="height:15.0pt" height="20"> <td style="height:15.0pt" height="20">ь</td> <td>\U+044C</td> </tr> <tr style="height:15.0pt" height="20"> <td style="height:15.0pt" height="20">б</td> <td>\U+0431</td> </tr> <tr style="height:15.0pt" height="20"> <td style="height:15.0pt" height="20">ю</td> <td>\U+044E</td> </tr> </tbody></table>When imported in CAD this works just fine. Russian letters appear.
So my question is, is there a way to translate the Russian letters in above stated manner, in the moment when macro saves the csv. To be perfectly clear, i want my excel unchanged, but the csv translated.
This is the code i use for csv save as:
Code:
Sub write_csv_xls() Application.DisplayAlerts = False xls = ActiveWorkbook.FullName Length = Len(xls) - 3 csv = Left(xls, Length) & "csv" ActiveWorkbook.SaveAs Filename:= _ csv, FileFormat:=xlCSV, _ CreateBackup:=False 'Delete the Existing copy of the file so we can save it back over it 'without the write-protected error Kill xls ActiveWorkbook.SaveAs Filename:= _ xls, FileFormat:=xlNormal, _ Password:="", WriteResPassword:="", ReadOnlyRecommended:= _ False, CreateBackup:=False Application.DisplayAlerts = True End Sub
Thanks in advance!